Skip to content

Commit 6aa2bbb

Browse files
committed
Consistent naming; comments
1 parent 90d0453 commit 6aa2bbb

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

examples/3_MultiGPU/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ source venv/bin/activate
3333
pip install -r requirements.txt
3434
```
3535

36-
You can check that everything is working by running `multigpu.py`:
36+
You can check that everything is working by running `simplenet.py`:
3737
```
38-
python3 multigpu.py
38+
python3 simplenet.py
3939
```
4040
As before, this defines the network and runs it with an input tensor
4141
[0.0, 1.0, 2.0, 3.0, 4.0]. The difference is that the code will make use of the
@@ -96,8 +96,8 @@ Fortran, run the executable with an argument of the saved model file:
9696
This runs the model with the same inputs as described above and should produce (some
9797
permutation of) the output:
9898
```
99-
input on rank0: [ 0.0, 1.0, 2.0, 3.0, 4.0]
100-
input on rank1: [ 1.0, 2.0, 3.0, 4.0, 5.0]
99+
input on device 0: [ 0.0, 1.0, 2.0, 3.0, 4.0]
100+
input on device 1: [ 1.0, 2.0, 3.0, 4.0, 5.0]
101101
output on device 0: [ 0.0, 2.0, 4.0, 6.0, 8.0]
102102
output on device 1: [ 2.0, 4.0, 6.0, 8.0, 10.0]
103103
```

examples/3_MultiGPU/multigpu_infer_fortran.f90

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ program inference
2626
type(torch_tensor), dimension(1) :: in_tensors
2727
type(torch_tensor), dimension(1) :: out_tensors
2828

29+
! Variables for multi-GPU setup
2930
integer, parameter :: num_devices = 2
3031
integer :: device_index, i
3132

examples/3_MultiGPU/multigpu_infer_python.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
"""Load saved MultiGPUNet to TorchScript and run inference example."""
1+
"""Load saved SimpleNet to TorchScript and run inference example."""
22

33
import torch
44

55

66
def deploy(saved_model: str, device: str, batch_size: int = 1) -> torch.Tensor:
77
"""
8-
Load TorchScript MultiGPUNet and run inference with example Tensor.
8+
Load TorchScript SimpleNet and run inference with example Tensor.
99
1010
Parameters
1111
----------
1212
saved_model : str
13-
location of MultiGPUNet model saved to Torchscript
13+
location of SimpleNet model saved to Torchscript
1414
device : str
1515
Torch device to run model on, 'cpu' or 'cuda'. May be followed by a colon and
1616
then a device index, e.g., 'cuda:0' for the 0th CUDA device.

0 commit comments

Comments
 (0)