Skip to content

Commit

Permalink
Set num_devices in Python example
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Feb 6, 2025
1 parent 3793c3d commit 3b67ae8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/3_MultiGPU/multigpu_infer_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def deploy(saved_model: str, device: str, batch_size: int = 1) -> torch.Tensor:
if __name__ == "__main__":
saved_model_file = "saved_multigpu_model_cuda.pt"

for device_index in range(2):
num_devices = 2

for device_index in range(num_devices):
device_to_run = f"cuda:{device_index}"

batch_size_to_run = 1
Expand Down

0 comments on commit 3b67ae8

Please sign in to comment.