-
Notifications
You must be signed in to change notification settings - Fork 25.3k
[ONNX] Export module as function #105618
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
[ONNX] Export module as function #105618
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/105618
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 99b3cee: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
Is the pass always turned on? Do we expect the current ort dev build to execute without errors when users want to test the new exporter? |
Yes. Yes for PT 2.1, and no for now. |
Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
…function" Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
@@ -171,6 +172,10 @@ | |||
"addmm", dtypes=onnx_test_common.BOOL_TYPES, | |||
reason=onnx_test_common.reason_onnx_does_not_support("Addmm") | |||
), | |||
xfail( | |||
"all", | |||
reason="[PostInline][ORT][ShapeInferenceError] axis must be in [-rank, rank-1]. input rank was 0" |
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.
Is it a regression?
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.
Haven't looked closely, likely due to inliner and unrelated to module as function.
Suspect related to inlining exposing the inner if op that conditions on input rank.
Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
…tion" Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
Introduce `Modularize` pass that analyzes the flat `fx.GraphModule` and creates nested layers of sub `fx.GraphModule`s along with the `call_module` fx nodes that invokes them. The analysis is done on the meta data "nn_module_stack", which captures the `nn.Module` each flat `fx.Node` belongs to. `FxOnnxInterpreter` is updated to support `call_module`. The related sub module linked by `node.target` is exported as an ONNX model local function. The `call_module` node itself is exported as an ONNX node, associated with the ONNX model local function by op_type. [ghstack-poisoned]
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
Introduce
Modularize
pass that analyzes the flatfx.GraphModule
and creates nestedlayers of sub
fx.GraphModule
s along with thecall_module
fx nodes that invokes them.The analysis is done on the meta data "nn_module_stack", which captures the
nn.Module
each flat
fx.Node
belongs to.FxOnnxInterpreter
is updated to supportcall_module
. The related sub module linkedby
node.target
is exported as an ONNX model local function. Thecall_module
node itselfis exported as an ONNX node, associated with the ONNX model local function by op_type.