Skip to content

Conversation

BowenBao
Copy link
Collaborator

@BowenBao BowenBao commented Jul 19, 2023

Stack from ghstack (oldest at bottom):

Introduce Modularize pass that analyzes the flat fx.GraphModule and creates nested
layers of sub fx.GraphModules 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.

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 19, 2023

🔗 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 Failures

As of commit 99b3cee:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: onnx torch.onnx related changes that should show up in the release notes label Jul 19, 2023
@BowenBao BowenBao added the topic: new features topic category label Jul 19, 2023
@BowenBao BowenBao marked this pull request as ready for review July 19, 2023 23:29
@BowenBao BowenBao requested review from justinchuby and titaiwangms and removed request for jeffdaily July 19, 2023 23:29
@justinchuby
Copy link
Collaborator

justinchuby commented Jul 19, 2023

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?

@BowenBao
Copy link
Collaborator Author

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"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it a regression?

Copy link
Collaborator Author

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]
BowenBao added a commit that referenced this pull request Jul 21, 2023
ghstack-source-id: d8d7439
Pull Request resolved: #105618
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]
BowenBao added a commit that referenced this pull request Jul 21, 2023
ghstack-source-id: 8dc9c6c
Pull Request resolved: #105618
…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]
BowenBao added a commit that referenced this pull request Jul 21, 2023
ghstack-source-id: a4484b4
Pull Request resolved: #105618
@wschin wschin self-requested a review July 21, 2023 20:49
@BowenBao BowenBao added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 24, 2023
@BowenBao BowenBao dismissed wschin’s stale review July 24, 2023 19:14

Discussed and resolved offline.

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]
BowenBao added a commit that referenced this pull request Jul 24, 2023
ghstack-source-id: 4c4e2d0
Pull Request resolved: #105618
@BowenBao
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@facebook-github-bot facebook-github-bot deleted the gh/BowenBao/268/head branch July 28, 2023 14:19
@wschin wschin restored the gh/BowenBao/268/head branch August 7, 2023 16:02
@facebook-github-bot facebook-github-bot deleted the gh/BowenBao/268/head branch August 8, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: onnx torch.onnx related changes that should show up in the release notes topic: new features topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants