Skip to content

[AIMIGRAPHX-1003] Add warnings for dim and value not set#4850

Open
eddieliao wants to merge 8 commits into
developfrom
input_warnings
Open

[AIMIGRAPHX-1003] Add warnings for dim and value not set#4850
eddieliao wants to merge 8 commits into
developfrom
input_warnings

Conversation

@eddieliao
Copy link
Copy Markdown
Contributor

Motivation

Warn the user when input dimensions or input values are not set, with the goal to improve usability.

Technical Details

Batch size is excluded from the warnings as it is common in most models and the default value of 1 typically works.

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.

@eddieliao eddieliao self-assigned this May 6, 2026
Copilot AI review requested due to automatic review settings May 6, 2026 22:16
@eddieliao eddieliao requested a review from causten as a code owner May 6, 2026 22:16
@eddieliao eddieliao added enhancement New feature or request onnx issues related to onnx support simple small or simple changes ok-to-test labels May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds user-facing warnings to improve usability when ONNX model inputs have unresolved symbolic dimensions or when the driver runs with inputs that were not explicitly provided.

Changes:

  • Emit a warning during ONNX parsing when symbolic dimension parameters are unbound (excluding “batch” dims).
  • Emit a warning in the driver when program inputs are not explicitly set via fill/load options.

Reviewed changes

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

File Description
src/onnx/onnx_parser.cpp Adds a pre-parse warning for unbound symbolic dimension parameters in graph inputs.
src/driver/main.cpp Adds a warning when running with inputs that are not explicitly populated (fill/load).

Comment thread src/onnx/onnx_parser.cpp
Comment thread src/onnx/onnx_parser.cpp
Comment thread src/onnx/onnx_parser.cpp Outdated
Comment thread src/driver/main.cpp Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4850      +/-   ##
===========================================
+ Coverage    92.66%   92.73%   +0.07%     
===========================================
  Files          588      588              
  Lines        30412    30439      +27     
===========================================
+ Hits         28180    28226      +46     
+ Misses        2232     2213      -19     
Files with missing lines Coverage Δ
src/api/api.cpp 74.73% <100.00%> (+1.49%) ⬆️
src/onnx/include/migraphx/onnx/onnx_parser.hpp 100.00% <ø> (ø)
src/onnx/onnx.cpp 100.00% <100.00%> (ø)
src/onnx/onnx_parser.cpp 89.03% <100.00%> (+0.46%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/driver/main.cpp
Comment thread src/onnx/onnx_parser.cpp Outdated
Comment thread src/onnx/onnx_parser.cpp
@gh-app-migraphx-bot-pr-write
Copy link
Copy Markdown

gh-app-migraphx-bot-pr-write Bot commented May 13, 2026

Test Batch New Rate (4957e6) Old Rate (f06671)* Diff Status
torchvision-resnet50 64 3,163.32 3,169.29 -0.19%
torchvision-resnet50_fp16 64 6,682.09 6,686.57 -0.07%
torchvision-densenet121 32 2,710.56 2,711.66 -0.04%
torchvision-densenet121_fp16 32 4,546.92 4,551.75 -0.11%
torchvision-inceptionv3 32 1,800.21 1,800.56 -0.02%
torchvision-inceptionv3_fp16 32 2,830.03 2,831.78 -0.06%
cadene-inceptionv4 16 826.50 826.73 -0.03%
cadene-resnext64x4 16 785.47 785.92 -0.06%
slim-mobilenet 64 8,435.70 8,443.76 -0.10%
slim-nasnetalarge 64 229.10 229.42 -0.14%
slim-resnet50v2 64 3,334.95 3,334.88 0.00%
bert-mrpc-onnx 8 1,172.72 1,172.86 -0.01%
bert-mrpc-tf 1 487.47 484.71 0.57%
pytorch-examples-wlang-gru 1 336.23 330.72 1.67%
pytorch-examples-wlang-lstm 1 450.73 562.40 -19.86% 🔴
torchvision-resnet50_1 1 756.90 774.90 -2.32%
cadene-dpn92_1 1 453.05 453.38 -0.07%
cadene-resnext101_1 1 364.36 363.28 0.30%
onnx-taau-downsample 1 402.70 401.93 0.19%
dlrm-criteoterabyte 1 32.60 32.60 0.00%
dlrm-criteoterabyte_fp16 1 52.60 52.66 -0.11%
agentmodel 1 8,759.33 10,594.32 -17.32% 🔴
unet_fp16 2 57.29 57.38 -0.15%
resnet50v1_fp16 1 939.71 981.88 -4.30%
resnet50v1_int8 1 931.48 940.18 -0.92%
bert_base_cased_fp16 64 1,103.02 1,104.55 -0.14%
bert_large_uncased_fp16 32 347.71 347.67 0.01%
bert_large_fp16 1 203.97 204.21 -0.12%
distilgpt2_fp16 16 2,097.23 2,094.87 0.11%
yolov5s 1 568.95 566.71 0.40%
tinyllama 1 46.14 46.12 0.03%
vicuna-fastchat 1 44.11 43.99 0.27%
whisper-tiny-encoder 1 420.34 420.88 -0.13%
whisper-tiny-decoder 1 418.12 417.01 0.27%
llama2_7b 1 20.49 20.48 0.09%
qwen1.5-7b 1 23.72 23.72 -0.02%
phi3-3.8b 1 27.02 26.92 0.40%
llama3-8b 1 21.87 21.87 0.01%
whisper-large-encoder 1 10.32 10.32 -0.04%
whisper-large-decoder 1 105.14 107.13 -1.86%
mistral-7b 1 23.92 23.93 -0.04%
FLUX.1-schnell 1 763.88 787.31 -2.98%

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
Copy link
Copy Markdown

gh-app-migraphx-bot-pr-write Bot commented May 13, 2026

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
distilgpt2_fp16 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-05-29 19:18:35.182870 [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:102: normalize_compute_shape: CONVOLUTION: mismatched channel numbers
whisper-large-decoder PASSED: MIGraphX meets tolerance
mistral-7b PASSED: MIGraphX meets tolerance
FLUX.1-schnell PASSED: MIGraphX meets tolerance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ok-to-test onnx issues related to onnx support simple small or simple changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants