[AIMIGRAPHX-1003] Add warnings for dim and value not set#4850
[AIMIGRAPHX-1003] Add warnings for dim and value not set#4850eddieliao wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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). |
Codecov Report❌ Patch coverage is
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
🚀 New features to boost your workflow:
|
| unset.insert(param.first); | ||
| if(unset.empty()) | ||
| return; | ||
| log::warn() << "Input(s) without explicit values: " << join_strings(std::move(unset), ", ") |
There was a problem hiding this comment.
Not all inputs require explicit values. Most dont require this. I think this warning is just too noisy.
There was a problem hiding this comment.
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.
| { | ||
| // 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) |
There was a problem hiding this comment.
The batch dimension is not always named batch so I dont think you can rely on that.
There was a problem hiding this comment.
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.
| } | ||
| if(unresolved.empty()) | ||
| return; | ||
| log::warn() << "Model has unbound symbolic dimension(s): " |
There was a problem hiding this comment.
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.
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.mdentry for any option other thanNot Applicable