mirror of
https://github.com/karpathy/nanochat.git
synced 2026-03-18 19:03:14 +00:00
Merge ec06564b46 into 1076f97059
This commit is contained in:
commit
667e34cdd1
|
|
@ -109,6 +109,11 @@ class WorkerPool:
|
|||
print(f"Initializing worker pool with {self.num_gpus} GPUs...")
|
||||
if self.num_gpus > 1:
|
||||
assert device_type == "cuda", "Only CUDA supports multiple workers/GPUs. cpu|mps does not."
|
||||
if device_type == "cuda" and self.num_gpus > torch.cuda.device_count():
|
||||
raise ValueError(
|
||||
f"--num-gpus {self.num_gpus} exceeds available GPUs ({torch.cuda.device_count()}). "
|
||||
"Use a value <= torch.cuda.device_count()."
|
||||
)
|
||||
|
||||
for gpu_id in range(self.num_gpus):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user