Skip to content

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

Open
eddieliao wants to merge 5 commits into
developfrom
input_warnings
Open

[AIMIGRAPHX-1003] Add warnings for dim and value not set#4850
eddieliao wants to merge 5 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.88%   92.95%   +0.07%     
===========================================
  Files          587      587              
  Lines        30348    30376      +28     
===========================================
+ Hits         28187    28234      +47     
+ Misses        2161     2142      -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.05% <100.00%> (+0.48%) ⬆️

... 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
unset.insert(param.first);
if(unset.empty())
return;
log::warn() << "Input(s) without explicit values: " << join_strings(std::move(unset), ", ")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not all inputs require explicit values. Most dont require this. I think this warning is just too noisy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The idea was to warn when users didn't set values for inputs such as the attention_mask and hopefully reduce the amount of tickets coming to us. Not sure if there's a good list out there for such inputs that require very specific values, but if not I can remove this warning.

Comment thread src/onnx/onnx_parser.cpp
{
// Skip batch dims and dims that are already set
if(d.has_dim_param() and not contains(parser.dim_params, d.dim_param()) and
to_lower(d.dim_param()).find("batch") == std::string::npos)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The batch dimension is not always named batch so I dont think you can rely on that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How often would a batch dimension not contain the word "batch"? The only example I can think of right now would be just using "N", which I can add an edge case for if desired.

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 (1446bc) Old Rate (929267)* Diff Status
torchvision-resnet50 64 3,170.86 3,172.18 -0.04%
torchvision-resnet50_fp16 64 6,680.09 6,689.77 -0.14%
torchvision-densenet121 32 2,715.15 2,597.32 4.54%
torchvision-densenet121_fp16 32 4,563.80 3,743.02 21.93% 🔆
torchvision-inceptionv3 32 1,801.24 1,774.31 1.52%
torchvision-inceptionv3_fp16 32 nan 2,831.91 nan
cadene-inceptionv4 16 827.53 824.30 0.39%
cadene-resnext64x4 16 786.34 786.74 -0.05%
slim-mobilenet 64 8,452.10 8,445.21 0.08%
slim-nasnetalarge 64 nan 229.07 nan

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 ERROR - check error output
resnet50v1 ERROR - check error output
bert_base_cased_fp16 ERROR - check error output
bert_large_uncased_fp16 ERROR - check error output
bert_large ERROR - check error output
yolov5s ERROR - check error output
tinyllama ERROR - check error output
vicuna-fastchat ERROR - check error output
llama2_7b ERROR - check error output
traceback
2026-05-20 15:48:31.094265 [WARN] [/data/src/onnx/onnx_parser.cpp:284] Model has unbound symbolic dimension(s): sequence_length. These default to 1 and may cause unexpected behavior. Try setting --dim-param @<name> <value> or --input-dim @<input> <dims> if program compilation fails.
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-20 16:02:40.781101 [WARN] [/data/src/onnx/onnx_parser.cpp:284] Model has unbound symbolic dimension(s): 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 ERROR - check error output
traceback
2026-05-20 16:05:08.532814 [WARN] [/data/src/onnx/onnx_parser.cpp:284] Model has unbound symbolic dimension(s): sequence_length. 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 246, in main
model.compile(
RuntimeError: /data/src/targets/gpu/kernel.cpp:70: load_module: Failed to load module: no kernel image is available for execution on the device
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.

3 participants