Skip to content

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

Open
eddieliao wants to merge 2 commits into
developfrom
input_warnings
Open

[AIMIGRAPHX-1003] Add warnings for dim and value not set#4850
eddieliao wants to merge 2 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

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/onnx/onnx_parser.cpp 78.57% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4850      +/-   ##
===========================================
- Coverage    92.81%   92.80%   -0.01%     
===========================================
  Files          584      584              
  Lines        30147    30160      +13     
===========================================
+ Hits         27978    27987       +9     
- Misses        2169     2173       +4     
Files with missing lines Coverage Δ
src/onnx/onnx_parser.cpp 88.22% <78.57%> (-0.35%) ⬇️

... and 4 files 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
}
if(unresolved.empty())
return;
log::warn() << "Model has unbound symbolic dimension(s): "
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.

We shouldn't warn if the user has called set_default_dim_value or set_default_dyn_dim_value. This is not just a driver warning.

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