Skip to content

Commit 9934345

Browse files
Map rocm and gpu to cuda (#251)
* Map rocm and gpu to cuda --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent e8b6d47 commit 9934345

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

script/app-mlperf-inference-mlcommons-python/customize.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ def get_run_cmd(os_info, env, scenario_extra_options,
219219
def get_run_cmd_reference(
220220
os_info, env, scenario_extra_options, mode_extra_options, dataset_options):
221221

222+
device = env['MLC_MLPERF_DEVICE'] if env['MLC_MLPERF_DEVICE'] not in [
223+
"gpu", "rocm"] else "cuda"
224+
222225
if env['MLC_MODEL'] in ["gptj-99", "gptj-99.9"]:
223226

224227
env['RUN_DIR'] = os.path.join(
@@ -352,8 +355,6 @@ def get_run_cmd_reference(
352355
"fid"))
353356

354357
backend = env['MLC_MLPERF_BACKEND']
355-
device = env['MLC_MLPERF_DEVICE'] if env['MLC_MLPERF_DEVICE'] not in [
356-
"gpu", "rocm"] else "cuda"
357358
max_batchsize = env.get('MLC_MLPERF_LOADGEN_MAX_BATCHSIZE', '1')
358359
cmd = env['MLC_PYTHON_BIN_WITH_PATH'] + " main.py " \
359360
" --scenario " + env['MLC_MLPERF_LOADGEN_SCENARIO'] + \
@@ -377,7 +378,6 @@ def get_run_cmd_reference(
377378
"language",
378379
"llama2-70b")
379380
backend = env['MLC_MLPERF_BACKEND']
380-
device = env['MLC_MLPERF_DEVICE'] if env['MLC_MLPERF_DEVICE'] != "gpu" else "cuda"
381381

382382
cmd = env['MLC_PYTHON_BIN_WITH_PATH'] + " main.py " \
383383
" --scenario " + env['MLC_MLPERF_LOADGEN_SCENARIO'] + \
@@ -410,7 +410,6 @@ def get_run_cmd_reference(
410410
"language",
411411
"mixtral-8x7b")
412412
backend = env['MLC_MLPERF_BACKEND']
413-
device = env['MLC_MLPERF_DEVICE'] if env['MLC_MLPERF_DEVICE'] != "gpu" else "cuda"
414413
cmd = env['MLC_PYTHON_BIN_WITH_PATH'] + " main.py " \
415414
" --scenario " + env['MLC_MLPERF_LOADGEN_SCENARIO'] + \
416415
" --dataset-path " + env['MLC_DATASET_MIXTRAL_PREPROCESSED_PATH'] + \
@@ -489,7 +488,6 @@ def get_run_cmd_reference(
489488
else:
490489
mode_extra_options += " --dataset igbh-dgl-tiny --profile debug-dgl "
491490

492-
device = env['MLC_MLPERF_DEVICE'] if env['MLC_MLPERF_DEVICE'] != "gpu" else "cuda"
493491
# have to add the condition for running in debug mode or real run mode
494492
cmd = env['MLC_PYTHON_BIN_WITH_PATH'] + " main.py " \
495493
" --scenario " + env['MLC_MLPERF_LOADGEN_SCENARIO'] + \

0 commit comments

Comments
 (0)