Skip to content

Conversation

@TedThemistokleous
Copy link
Collaborator

Description

  • Add fixes for control flow operators that were causing odd cases with subgraphs
  • Add show when we have unsupported operators without the need for using the _dump_model_ops flag
  • Add support for the Size operator in models
  • Simplify model dumping code and encapsulate this operation in the EP
  • Additional output for canEvalNodeArgument() - Give user clear indication of which OP + Input is failing and why

Motivation and Context

Changes found for control flow, size operator and other debug fixes and cleanup

We want to be clear there's an unsupported op in the run on initial get capabilities to be clear where graph break occur
The requiring dump model ops code wasn't clear to use when we have unsupported ops to the user if there is missing support

Added some additional debug output (warnings) if an input op isn't supported due to issues with evaluation. This isn't obvious if an operator fails due to shape or const tensor inputs.

Should make debugging easier more clear before we start getting into subGraph optimization, splits and partitioning. Especially important when there's cases where say a subgraph has inputs that seemingly error out and can't be evaluated correctly as the input isn't found but exists in the parent graph (As seen with the IF operator)
Should be clear which node and corresponding input is being filtered out by the MIGraphX EP.  This is useful to hunt down operators who may be either malformed or incorrectly handled due to subgraphs/splits/partitioning
Put this logic behind dump_model_as_onnx call to avoid repeated code .
@TedThemistokleous TedThemistokleous self-assigned this Nov 6, 2025
@TedThemistokleous TedThemistokleous added Cleanup Cleanup or simplify blocks of code Bugfix Fix to a bug or reported issue labels Nov 6, 2025
@TedThemistokleous
Copy link
Collaborator Author

This will supersede - #195

@TedThemistokleous TedThemistokleous added the Upstream Changset that should be merged upstream to Microsoft/Onnxruntime label Nov 6, 2025
return isInputNode(n, input_name);
});
if (nit == in_nodes.end()) {
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Can't Find node to name";
Copy link

Choose a reason for hiding this comment

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

Suggested change
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Can't Find node to name";
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Cannot find node to name";

"SimplifiedLayerNormalization",
"Sin",
"Sinh",
"Size",
Copy link

Choose a reason for hiding this comment

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

Question; Is this needed for other changes in this? Wondering if it makes more sense to add this in a separate PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Its a one line change it was needed for a customer. Bundling all that work into on PR.

Comment on lines +821 to +826
// if graph is split we dont know if output is used so we need this, otherwise if the graph isn't split
// then we can safely assume this output is a dangling output from a node and to discard it as part of the
// final graph output
if (is_graph_split) {
output_names.push_back(name);
}
Copy link

Choose a reason for hiding this comment

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

Is there a change you made here? Seems identical except the format of braces.
Not sure why the comment is also showing as a change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Formatting with lintrunner


// Input cannot be constant folded
if (IsGraphInput(graph, input_name)) {
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Can't be const folded";
Copy link

Choose a reason for hiding this comment

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

Suggested change
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Can't be const folded";
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Cannot be const folded";

}

if (!canEvalShapeGeneral(graph, *nit, input_nodes)) {
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Can't eval shape";
Copy link

Choose a reason for hiding this comment

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

Suggested change
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Can't eval shape";
LOGS_DEFAULT(WARNING) << "Node:" << node->Name() << " Input:" << input_name << " Cannot eval shape";

@TedThemistokleous
Copy link
Collaborator Author

@apwojcik should cherry pick this to wml main since it has the debug code broken away from the dump_model_ops if you're hitting unsupported ops or issues with preprocessing operators with invalid inputs for some of the newer graphs seen on the windows/UAI side.

@TedThemistokleous TedThemistokleous merged commit c4e1e69 into rocm7.1_internal_testing Nov 7, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix Fix to a bug or reported issue Cleanup Cleanup or simplify blocks of code Upstream Changset that should be merged upstream to Microsoft/Onnxruntime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants