-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Experimental] Add a path to fallback more nodes to CPUs #19875
base: main
Are you sure you want to change the base?
Conversation
Shape-related nodes don't only start with `Shape` or `Size`. In dynamo-captured ONNX model, it can starts with a graph input. A new transform is added to fallback `all` nodes which can be reversely traversed from a `shape-like` variable. Some `shape-like` variables are list below. - all inputs of Range - 2nd input of Reshape - 2nd input of Unsqueeze - 1st input of ConstantOfShape - 2nd-to-last inputs of Slice. Fix header Remove unused variable Versioning shape inputs Fix
Fix typo Write to fixed place Remove unused import's run it Fix Change test location
cc64a2e
to
526b166
Compare
// checking shapes will make the algorithm more unstable now. | ||
LOGS_DEFAULT(VERBOSE) << "Call GetShapeRelatedNodes to identify extra CPU nodes." << std::endl; | ||
|
||
const static InlinedHashMap<std::string_view, InlinedHashMap<int64_t, std::vector<size_t>>> shape_related_inputs_in_nodes = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious to hear your thoughts on this - https://github.com/microsoft/onnxruntime/pull/19769/files#r1515337499
// | ||
// The traversal should stop when | ||
// 1. hitting Shape, Size nodes, graph inputs, or graph initializers. | ||
// 2. [TODO] hitting nodes with some large inputs or outputs. Before that, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more TODO documentation suggestions- #19769 (comment)
The same code as #19769. I can't update that PR anymore since I force-push a change.