fix: alternate GPUs for each shard (0,1,0,1)
This commit is contained in:
@@ -96,7 +96,7 @@ def streaming_quantize(model_path: str, output_path: str):
|
|||||||
futures = []
|
futures = []
|
||||||
for j, shard_file in enumerate(batch):
|
for j, shard_file in enumerate(batch):
|
||||||
idx = i + j
|
idx = i + j
|
||||||
gpu_id = (j // shards_per_gpu) % num_gpus # Assign to GPU
|
gpu_id = idx % num_gpus # Alternate GPUs: 0,1,0,1...
|
||||||
futures.append(executor.submit(process_shard, idx, shard_file, gpu_id))
|
futures.append(executor.submit(process_shard, idx, shard_file, gpu_id))
|
||||||
for future in concurrent.futures.as_completed(futures):
|
for future in concurrent.futures.as_completed(futures):
|
||||||
future.result()
|
future.result()
|
||||||
|
|||||||
Reference in New Issue
Block a user