Skip to content

Commit

Permalink
Rocm6.3 turn off ort ops for migx (#55)
Browse files Browse the repository at this point in the history
* Force MIGraphXEP when MIGraphX is chosen

* Fix lint
  • Loading branch information
TedThemistokleous authored Aug 20, 2024
1 parent 6c24c3f commit 479c2c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions onnxruntime/python/tools/transformers/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ def run_onnxruntime(
)
return results

if provider == "migraphx":
optimizer_info = OptimizerInfo.NOOPT
warm_up_repeat = 5
if "MIGraphXExecutionProvider" not in onnxruntime.get_available_providers():
logger.error(
"Please install onnxruntime-rocm package, and use a machine with GPU for testing gpu performance."
)
return results

if optimizer_info == OptimizerInfo.NOOPT:
logger.warning(
f"OptimizerInfo is set to {optimizer_info}, graph optimizations specified in FusionOptions are not applied."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,12 @@ def main(argv=None, experiment_name: str = "", run_id: str = "0", csv_filename:
logger.info(f"Output path: {output_path}")
model_size_in_MB = int(get_onnx_model_size(output_path, args.use_external_data_format) / 1024 / 1024) # noqa: N806

provider = args.provider
if args.provider == "migraphx":
provider = "MIGraphXExecutionProvider"

session = create_onnxruntime_session(
output_path, args.use_gpu, args.provider, enable_all_optimization=True, verbose=args.verbose
output_path, args.use_gpu, provider, enable_all_optimization=True, verbose=args.verbose
)
if args.model_class == "GPT2LMHeadModel" and session is not None:
parity_result = gpt2helper.test_parity(
Expand Down

0 comments on commit 479c2c5

Please sign in to comment.