Skip to content

NOT TO BE MERGED: Python script to benchmark mxr files - consumes mxr files with json encoding#4983

Draft
ahsan-ca wants to merge 3 commits into
developfrom
benchmark-script-python
Draft

NOT TO BE MERGED: Python script to benchmark mxr files - consumes mxr files with json encoding#4983
ahsan-ca wants to merge 3 commits into
developfrom
benchmark-script-python

Conversation

@ahsan-ca

Copy link
Copy Markdown
Contributor

Motivation

For REVIEW purposes only.

Technical Details

Changelog Category

Add a CHANGELOG.md entry for any option other than Not Applicable

    • Added: New functionality.
    • Changed: Changes to existing functionality.
    • Removed: Functionality or support that has been removed. (Compared to a previous release)
    • Optimized: Component performance that has been optimized or improved.
    • Resolved Issues: Known issues from a previous version that have been resolved.
    • Not Applicable: This PR is not to be included in the changelog.

@ahsan-ca ahsan-ca requested review from kahmed10 and pfultz2 June 17, 2026 18:42
@ahsan-ca ahsan-ca self-assigned this Jun 17, 2026
@ahsan-ca ahsan-ca requested a review from causten as a code owner June 17, 2026 18:42
Copilot AI review requested due to automatic review settings June 17, 2026 18:42
@ahsan-ca ahsan-ca marked this pull request as draft June 17, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new developer utility script under tools/ intended to benchmark GPU-dumped .mxr artifacts and produce a problem_cache.json consumable via MIGRAPHX_PROBLEM_CACHE.

Changes:

  • Introduces tools/benchmark_mxr.py to load .mxr files, run warmup/benchmark iterations, and emit a consolidated problem cache JSON.

Comment thread tools/benchmark_mxr.py
Comment on lines +1 to +10
#!/usr/bin/env python3
"""Benchmark dumped MIGraphX .mxr files and emit a problem cache.

.mxr files dumped via MIGRAPHX_GPU_DUMP_BENCHMARK_MXR.

After problem_cache.json file is generated by this script,
use MIGRAPHX_PROBLEM_CACHE=problem_cache.json to consume it.

Usage: benchmark_mxr.py <mxr_dir>
"""
Comment thread tools/benchmark_mxr.py
Comment thread tools/benchmark_mxr.py
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4983   +/-   ##
========================================
  Coverage    92.73%   92.73%           
========================================
  Files          594      594           
  Lines        31340    31340           
========================================
  Hits         29063    29063           
  Misses        2277     2277           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gh-app-migraphx-bot-pr-write

gh-app-migraphx-bot-pr-write Bot commented Jun 17, 2026

Copy link
Copy Markdown
Test Batch New Rate (91fd4b) Old Rate (241f7a)* Diff Status
torchvision-resnet50 64 1,973.42 3,158.05 -37.51% 🔴
torchvision-resnet50_fp16 64 2,618.84 6,678.10 -60.78% 🔴
torchvision-densenet121 32 716.98 2,705.33 -73.50% 🔴
torchvision-densenet121_fp16 32 438.74 4,480.31 -90.21% 🔴
torchvision-inceptionv3 32 638.59 1,772.37 -63.97% 🔴
torchvision-inceptionv3_fp16 32 1,934.74 2,613.31 -25.97% 🔴
cadene-inceptionv4 16 775.95 444.89 74.41% 🔆
cadene-resnext64x4 16 328.85 412.50 -20.28% 🔴
slim-mobilenet 64 3,853.17 8,419.17 -54.23% 🔴
slim-nasnetalarge 64 nan nan nan
slim-resnet50v2 64 895.68 1,641.82 -45.45% 🔴
bert-mrpc-onnx 8 463.60 1,165.20 -60.21% 🔴
bert-mrpc-tf 1 124.91 492.10 -74.62% 🔴
pytorch-examples-wlang-gru 1 233.90 334.96 -30.17% 🔴
pytorch-examples-wlang-lstm 1 430.90 469.54 -8.23% 🔴
torchvision-resnet50_1 1 145.00 760.64 -80.94% 🔴
cadene-dpn92_1 1 74.71 457.65 -83.68% 🔴
cadene-resnext101_1 1 362.11 363.68 -0.43%
onnx-taau-downsample 1 398.22 401.93 -0.92%
dlrm-criteoterabyte 1 26.79 12.36 116.72% 🔆
dlrm-criteoterabyte_fp16 1 50.50 29.66 70.28% 🔆
agentmodel 1 10,124.11 10,523.13 -3.79%
unet_fp16 2 34.40 57.23 -39.88% 🔴
resnet50v1_fp16 1 903.35 959.87 -5.89% 🔴
resnet50v1_int8 1 853.16 942.92 -9.52% 🔴
bert_base_cased_fp16 64 475.03 1,092.47 -56.52% 🔴
bert_large_uncased_fp16 32 271.22 345.19 -21.43% 🔴
bert_large_fp16 1 24.55 203.23 -87.92% 🔴
distilgpt2_fp16 16 818.94 2,096.77 -60.94% 🔴
yolov5s 1 119.08 564.74 -78.91% 🔴
tinyllama 1 16.40 46.00 -64.34% 🔴
vicuna-fastchat 1 41.72 44.04 -5.27% 🔴
whisper-tiny-encoder 1 416.79 419.55 -0.66%
whisper-tiny-decoder 1 140.86 414.85 -66.05% 🔴
llama2_7b 1 3.14 20.42 -84.62% 🔴
qwen1.5-7b 1 11.34 21.75 -47.85% 🔴
phi3-3.8b 1 26.60 26.81 -0.77%
llama3-8b 1 21.12 21.83 -3.27%
whisper-large-encoder 1 7.18 6.50 10.58% 🔆
whisper-large-decoder 1 1.89 106.80 -98.23% 🔴
mistral-7b 1 5.04 23.85 -78.86% 🔴
FLUX.1-schnell 1 162.29 763.88 -78.75% 🔴

Regressions detected 🔴

* No develop baseline was found for this PR's branch point; compared against the latest available develop run instead.

@gh-app-migraphx-bot-pr-write

gh-app-migraphx-bot-pr-write Bot commented Jun 17, 2026

Copy link
Copy Markdown
Test Status Result
bert-mrpc-onnx PASSED: MIGraphX meets tolerance
bert-mrpc-tf ERROR - check error output
traceback
Traceback (most recent call last):
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 377, in
main()
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 313, in main
import tensorflow as tf
File "/usr/local/lib/python3.10/dist-packages/tensorflow/init.py", line 38, in
from tensorflow.python.tools import module_util as _module_util
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/init.py", line 36, in
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 26, in
self_check.preload_check()
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/platform/self_check.py", line 63, in preload_check
from tensorflow.python.platform import _pywrap_cpu_feature_guard
ImportError: libamdhip64.so.6: cannot open shared object file: No such file or directory
pytorch-examples-wlang-gru PASSED: MIGraphX meets tolerance
pytorch-examples-wlang-lstm PASSED: MIGraphX meets tolerance
dlrm-criteoterabyte PASSED: MIGraphX meets tolerance
agentmodel PASSED: MIGraphX meets tolerance
unet PASSED: MIGraphX meets tolerance
resnet50v1 PASSED: MIGraphX meets tolerance
bert_base_cased_fp16 PASSED: MIGraphX meets tolerance
bert_large_uncased_fp16 🔴 FAILED: MIGraphX is not within tolerance - check verbose output
bert_large PASSED: MIGraphX meets tolerance
yolov5s PASSED: MIGraphX meets tolerance
tinyllama PASSED: MIGraphX meets tolerance
vicuna-fastchat PASSED: MIGraphX meets tolerance
whisper-tiny-encoder PASSED: MIGraphX meets tolerance
whisper-tiny-decoder PASSED: MIGraphX meets tolerance
llama2_7b PASSED: MIGraphX meets tolerance
qwen1.5-7b PASSED: MIGraphX meets tolerance
phi3-3.8b PASSED: MIGraphX meets tolerance
llama3-8b PASSED: MIGraphX meets tolerance
whisper-large-encoder ERROR - check error output
traceback
2026-06-17 22:26:36.106505 [WARN] [/data/src/onnx/onnx_parser.cpp:282] Model has unbound symbolic dimension(s): batch_size, encoder_sequence_length, feature_size. These default to 1 and may cause unexpected behavior. Try setting --dim-param @<name> <value> or --input-dim @<input> <dims> if program compilation fails.
Traceback (most recent call last):
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 377, in
main()
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 224, in main
model = migraphx.parse_onnx(model_name, default_dim_value=batch)
RuntimeError: /data/src/include/migraphx/op/convolution.hpp:113: normalize_compute_shape: CONVOLUTION: mismatched channel numbers: input channels (1) != weights channels (80) * group (1)
whisper-large-decoder PASSED: MIGraphX meets tolerance
mistral-7b PASSED: MIGraphX meets tolerance
FLUX.1-schnell PASSED: MIGraphX meets tolerance

@ahsan-ca ahsan-ca force-pushed the benchmark-script-python branch from 31e77e7 to b84b23a Compare June 17, 2026 21:47
@ahsan-ca ahsan-ca force-pushed the benchmark-script-python branch from b84b23a to 91fd4b3 Compare June 17, 2026 21:49
@ahsan-ca ahsan-ca changed the base branch from develop to benchmark-mxr-format-change June 17, 2026 21:50
@ahsan-ca ahsan-ca requested a review from Copilot June 17, 2026 21:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread tools/benchmark_mxr.py
Comment on lines +1 to +10
#!/usr/bin/env python3
"""Benchmark dumped MIGraphX .mxr files and emit a problem cache.

.mxr files dumped via MIGRAPHX_GPU_DUMP_BENCHMARK_MXR.

After problem_cache.json file is generated by this script,
use MIGRAPHX_PROBLEM_CACHE=problem_cache.json to consume it.

Usage: benchmark_mxr.py <mxr_dir>
"""
Comment thread tools/benchmark_mxr.py
Comment on lines +23 to +25
text = next(i.op().values()["text"] for i in p.get_main_module()
if i.name() == "@comment")
meta = dict(json.loads(text))
@ahsan-ca ahsan-ca added the skip bot checks Skips the Performance and Accuracy CI tests label Jun 17, 2026
Base automatically changed from benchmark-mxr-format-change to develop June 18, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip bot checks Skips the Performance and Accuracy CI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants