Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions automotive/3d-object-detection/backend_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def name(self):
return "python-SUT"

def load(self):
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
PaintArgs = namedtuple(
'PaintArgs', [
'training_path', 'model_path', 'cam_sync'])
Expand Down Expand Up @@ -84,7 +84,7 @@ def predict(self, inputs):
], [], [], [], [], [], []
with torch.inference_mode():
device = torch.device(
"cuda:0" if torch.cuda.is_available() else "cpu")
"cuda" if torch.cuda.is_available() else "cpu")
model_input = inputs[0]
batched_pts = model_input['pts']
scores_from_cam = []
Expand Down
2 changes: 1 addition & 1 deletion language/bert/pytorch_SUT.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, args):

self.network = args.network
self.dev = (
torch.device("cuda:0") if torch.cuda.is_available(
torch.device("cuda") if torch.cuda.is_available(
) else torch.device("cpu")
)
self.version = transformers.__version__
Expand Down
2 changes: 1 addition & 1 deletion language/gpt-j/backend_PyTorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(
if self.use_gpu:
print(f"Casting models to GPU...")
assert torch.cuda.is_available(), "torch gpu is not available, exiting..."
self.device = torch.device("cuda:0")
self.device = torch.device("cuda")
self.model.to(self.device)

self.model.eval()
Expand Down
2 changes: 1 addition & 1 deletion language/llama2-70b/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ python3 -u main.py --scenario Offline \
--dataset-path ${DATASET_PATH} \
--output-log-dir offline-logs \
--dtype float32 \
--device cuda:0 2>&1 | tee offline_performance_log.log
--device cuda 2>&1 | tee offline_performance_log.log
```

### Server
Expand Down
2 changes: 1 addition & 1 deletion language/llama2-70b/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_args():
parser.add_argument(
"--device",
type=str,
choices=["cpu", "cuda:0"],
choices=["cpu", "cuda"],
default="cpu",
help="device to use",
)
Expand Down
2 changes: 1 addition & 1 deletion language/llama2-70b/run_accuracy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ python3 -u main.py --scenario Offline \
--dataset-path ${DATASET_PATH} \
--output-log-dir offline_accuracy_loadgen_logs \
--dtype float32 \
--device cuda:0 2>&1 | tee offline_accuracy_log.log
--device cuda 2>&1 | tee offline_accuracy_log.log

python3 evaluate-accuracy.py --checkpoint-path ${CHECKPOINT_PATH} \
--mlperf-accuracy-file offline_accuracy_loadgen_logs/mlperf_log_accuracy.json \
Expand Down
2 changes: 1 addition & 1 deletion language/mixtral-8x7b/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ python3 -u main.py --scenario Offline \
--dataset-path ${DATASET_PATH} \
--output-log-dir offline-logs \
--dtype float32 \
--device cuda:0 2>&1 | tee offline_performance_log.log
--device cuda 2>&1 | tee offline_performance_log.log
```

### Server
Expand Down
2 changes: 1 addition & 1 deletion language/mixtral-8x7b/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_args():
parser.add_argument(
"--device",
type=str,
choices=["cpu", "cuda:0"],
choices=["cpu", "cuda"],
default="cpu",
help="device to use",
)
Expand Down
2 changes: 1 addition & 1 deletion language/mixtral-8x7b/run_accuracy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ python3 -u main.py --scenario Offline \
--dataset-path ${DATASET_PATH} \
--output-log-dir offline_accuracy_loadgen_logs \
--dtype float32 \
--device cuda:0 2>&1 | tee offline_accuracy_log.log
--device cuda 2>&1 | tee offline_accuracy_log.log

python3 evaluate-accuracy.py --checkpoint-path ${CHECKPOINT_PATH} \
--mlperf-accuracy-file offline_accuracy_loadgen_logs/mlperf_log_accuracy.json \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
os.environ["MASTER_ADDR"] = "localhost"
os.environ["MASTER_PORT"] = "29500"
if self.use_gpu:
self.device: torch.device = torch.device(f"cuda:0")
self.device: torch.device = torch.device(f"cuda")
self.dist_backend = "nccl"
# torch.cuda.set_device(self.device)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, m_spa, ln_emb, ln_bot, ln_top,
self.ln_top = ln_top

self.use_gpu = use_gpu and torch.cuda.is_available()
self.device = "cuda:0" if self.use_gpu else "cpu"
self.device = "cuda" if self.use_gpu else "cpu"

ngpus = torch.cuda.device_count() if self.use_gpu else -1
self.ndevices = min(ngpus, mini_batch_size, ln_emb.size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, blank_index, model, max_symbols_per_step=30):
self._blank_id = blank_index
self._SOS = -1
self.dev = (
torch.device("cuda:0")
torch.device("cuda")
if torch.cuda.is_available()
and os.environ.get("USE_GPU", "").lower() not in ["no", "false"]
else torch.device("cpu")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(
):
super().__init__()
self.dev = (
torch.device("cuda:0")
torch.device("cuda")
if torch.cuda.is_available()
and os.environ.get("USE_GPU", "").lower() not in ["no", "false"]
else torch.device("cpu")
Expand Down Expand Up @@ -122,7 +122,7 @@ def __init__(
):
super().__init__()
self.dev = (
torch.device("cuda:0")
torch.device("cuda")
if torch.cuda.is_available()
and os.environ.get("USE_GPU", "").lower() not in ["no", "false"]
else torch.device("cpu")
Expand Down Expand Up @@ -195,7 +195,7 @@ def __init__(
):
super().__init__()
self.dev = (
torch.device("cuda:0")
torch.device("cuda")
if torch.cuda.is_available()
and os.environ.get("USE_GPU", "").lower() not in ["no", "false"]
else torch.device("cpu")
Expand Down
4 changes: 2 additions & 2 deletions retired_benchmarks/speech_recognition/rnnt/pytorch/rnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
"""
super(LstmDrop, self).__init__()
self.dev = (
torch.device("cuda:0")
torch.device("cuda")
if torch.cuda.is_available()
and os.environ.get("USE_GPU", "").lower() not in ["no", "false"]
else torch.device("cpu")
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(self, factor):
super().__init__()
self.factor = int(factor)
self.dev = (
torch.device("cuda:0")
torch.device("cuda")
if torch.cuda.is_available()
and os.environ.get("USE_GPU", "").lower() not in ["no", "false"]
else torch.device("cpu")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(
featurizer_config = config["input_eval"]

self.dev = (
torch.device("cuda:0")
torch.device("cuda")
if torch.cuda.is_available()
and os.environ.get("USE_GPU", "").lower() not in ["no", "false"]
else torch.device("cpu")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def load(self, model_path, inputs=None, outputs=None):
self.outputs.append(i.name)

# prepare the backend
device = "CUDA:0" if torch.cuda.is_available() else "CPU"
device = "cuda" if torch.cuda.is_available() else "CPU"
self.sess = caffe2.python.onnx.backend.prepare(self.model, device)
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self):
super(BackendPytorchNative, self).__init__()
self.sess = None
self.model = None
self.device = "cuda:0" if torch.cuda.is_available() else "cpu"
self.device = "cuda" if torch.cuda.is_available() else "cpu"

def version(self):
return torch.__version__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(
)
self.trainer.load_checkpoint_ram(params[0], False)
self.device = torch.device(
"cuda:0" if torch.cuda.is_available() else "cpu")
"cuda" if torch.cuda.is_available() else "cpu")

print("Constructing SUT...")
self.sut = lg.ConstructSUT(self.issue_queries, self.flush_queries)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def main():
width = 224
depth = 160
channels = 4
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
dummy_input = torch.rand(
[1, channels, height, width, depth]).float().to(device)
torch.onnx.export(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def load(self, model_path, inputs=None, outputs=None):
self.outputs.append(i.name)

# prepare the backend
device = "CUDA:0" if torch.cuda.is_available() else "CPU"
device = "cuda" if torch.cuda.is_available() else "CPU"
self.sess = caffe2.python.onnx.backend.prepare(self.model, device)
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self):
super(BackendPytorchNative, self).__init__()
self.sess = None
self.model = None
self.device = "cuda:0" if torch.cuda.is_available() else "cpu"
self.device = "cuda" if torch.cuda.is_available() else "cpu"

def version(self):
return torch.__version__
Expand Down
2 changes: 1 addition & 1 deletion vision/medical_imaging/3d-unet-kits19/pytorch_SUT.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, model_path, preprocessed_data_dir, performance_count):
model_path
)
self.device = torch.device(
"cuda:0" if torch.cuda.is_available() else "cpu")
"cuda" if torch.cuda.is_available() else "cpu")
self.model = torch.jit.load(model_path, map_location=self.device)
self.model.eval()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def __init__(self, model_path, preprocessed_data_dir, performance_count):
model_path
)
self.device = torch.device(
"cuda:0" if torch.cuda.is_available() else "cpu")
"cuda" if torch.cuda.is_available() else "cpu")
self.model = Unet3D()
self.model.to(self.device)
checkpoint = torch.load(model_path, map_location=self.device)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def main():
assert Path(model_path).is_file(), "Cannot find the model file {:}!".format(
model_path
)
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

model = torch.jit.load(model_path, map_location=device)
model.eval()
Expand Down