Skip to content

Commit

Permalink
move model to cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
zewenli98 committed Dec 18, 2024
1 parent a239d0d commit aac32ae
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/perf/perf_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ def run_dynamo(model, input_tensors, params, precision, batch_size):
" batch_size : ",
batch_size,
)
model = model.to("cuda:0")
if params["is_text_llm"]:
return run_hf_dynamo(model, input_tensors, params, precision, batch_size)

Expand Down Expand Up @@ -638,9 +637,9 @@ def run(
# Load PyTorch Model, if provided
if len(model_name_torch) > 0 and os.path.exists(model_name_torch):
print("Loading user provided torch model: ", model_name_torch)
model_torch = torch.load(model_name_torch).eval()
model_torch = torch.load(model_name_torch).cuda().eval()
elif model_name_torch in BENCHMARK_MODELS:
model_torch = BENCHMARK_MODELS[model_name_torch]["model"].eval()
model_torch = BENCHMARK_MODELS[model_name_torch]["model"].cuda().eval()

# If neither model type was provided
if (model is None) and (model_torch is None):
Expand Down

0 comments on commit aac32ae

Please sign in to comment.