Skip to content

Fix standalone compile for op with multiple outputs#96936

Closed
Valentine233 wants to merge 1 commit intomasterfrom
fix_standalone_compile
Closed

Fix standalone compile for op with multiple outputs#96936
Valentine233 wants to merge 1 commit intomasterfrom
fix_standalone_compile

Conversation

@Valentine233
Copy link
Collaborator

@Valentine233 Valentine233 commented Mar 16, 2023

Op-benchmark directly uses fx.Graph to create nodes without dynamo and then compiles the graph with inductor. Currently, operators with multiple outputs, e.g. native_layer_norm, would fail to run caused by standalone torch._inductor.compile() API #95594. Actually, the graph's result is a node with several outputs instead of a tuple with several nodes. However, the standalone API forces a non-tuple result be a tuple, i.e., a tuple with one node-type element with several outputs. This PR considers a return node with several outputs as a tuple to avoid errors.

cc @soumith @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 16, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/96936

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

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

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

@Valentine233 Valentine233 added the topic: not user facing topic category label Mar 16, 2023
@ezyang ezyang requested review from jansel and jgong5 March 16, 2023 16:23
@ezyang ezyang added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Mar 16, 2023
@Valentine233 Valentine233 force-pushed the fix_standalone_compile branch from 7dcfa56 to c8ce8e2 Compare March 17, 2023 02:21
@Valentine233 Valentine233 added the ciflow/trunk Trigger trunk jobs on your pull request label Mar 17, 2023
@Valentine233 Valentine233 requested a review from EikanWang March 17, 2023 02:54
Copy link
Collaborator

@jgong5 jgong5 left a comment

Choose a reason for hiding this comment

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

LGTM except for a small nit in the test code.

Copy link
Collaborator

Choose a reason for hiding this comment

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

can we pass torch.ops.aten.native_layer_norm.default directly to gen_gm_and_inputs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@Valentine233 Valentine233 force-pushed the fix_standalone_compile branch from c8ce8e2 to 26ef729 Compare March 17, 2023 03:22
@Valentine233
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

@kit1980
Copy link
Contributor

kit1980 commented Mar 19, 2023

@pytorchbot revert -m "Broke inductor tests on macos-12-py3-arm64 https://github.com/pytorch/pytorch/actions/runs/4458548491/jobs/7830566793" -c nosignal

@kit1980
Copy link
Contributor

kit1980 commented Mar 19, 2023

@Valentine233 sorry I have to revert this. Please fix for macos-12-py3-arm64 and re-land.

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@Valentine233 your PR has been successfully reverted.

@kit1980
Copy link
Contributor

kit1980 commented Mar 19, 2023

Looks like this PR was not the reason for the test failure, it was a mistake to revert it.
I'll reland it soon.

@kit1980 kit1980 reopened this Mar 20, 2023
@kit1980 kit1980 added the ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR label Mar 20, 2023
@kit1980
Copy link
Contributor

kit1980 commented Mar 20, 2023

@pytorchbot rebase

@kit1980 kit1980 removed the Reverted label Mar 20, 2023
@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a rebase job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Rebase failed due to

Aborting rebase because rebasing the branch resulted in the same sha as the target branch.
This usually happens because the PR has already been merged.  Please rebase locally and push.

Raised by https://github.com/pytorch/pytorch/actions/runs/4463722719

@kit1980
Copy link
Contributor

kit1980 commented Mar 20, 2023

@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: periodic / linux-focal-rocm5.4.2-py3.8 / test (distributed, 1, 2, linux.rocm.gpu)

Details for Dev Infra team Raised by workflow job

@kit1980
Copy link
Contributor

kit1980 commented Mar 20, 2023

@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

cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 23, 2023
Op-benchmark directly uses fx.Graph to create nodes without dynamo and then compiles the graph with inductor. Currently, operators with multiple outputs, e.g. native_layer_norm, would fail to run caused by standalone torch._inductor.compile() API #95594. Actually, the graph's result is a node with several outputs instead of a tuple with several nodes. However, the standalone API forces a non-tuple result be a tuple, i.e., a tuple with one node-type element with several outputs. This PR considers a return node with several outputs as a tuple to avoid errors.

Pull Request resolved: pytorch/pytorch#96936
Approved by: https://github.com/jgong5, https://github.com/jansel
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 23, 2023
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 23, 2023
Op-benchmark directly uses fx.Graph to create nodes without dynamo and then compiles the graph with inductor. Currently, operators with multiple outputs, e.g. native_layer_norm, would fail to run caused by standalone torch._inductor.compile() API #95594. Actually, the graph's result is a node with several outputs instead of a tuple with several nodes. However, the standalone API forces a non-tuple result be a tuple, i.e., a tuple with one node-type element with several outputs. This PR considers a return node with several outputs as a tuple to avoid errors.

Pull Request resolved: pytorch/pytorch#96936
Approved by: https://github.com/jgong5, https://github.com/jansel
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 27, 2023
Op-benchmark directly uses fx.Graph to create nodes without dynamo and then compiles the graph with inductor. Currently, operators with multiple outputs, e.g. native_layer_norm, would fail to run caused by standalone torch._inductor.compile() API #95594. Actually, the graph's result is a node with several outputs instead of a tuple with several nodes. However, the standalone API forces a non-tuple result be a tuple, i.e., a tuple with one node-type element with several outputs. This PR considers a return node with several outputs as a tuple to avoid errors.

Pull Request resolved: pytorch/pytorch#96936
Approved by: https://github.com/jgong5, https://github.com/jansel
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 27, 2023
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 27, 2023
Op-benchmark directly uses fx.Graph to create nodes without dynamo and then compiles the graph with inductor. Currently, operators with multiple outputs, e.g. native_layer_norm, would fail to run caused by standalone torch._inductor.compile() API #95594. Actually, the graph's result is a node with several outputs instead of a tuple with several nodes. However, the standalone API forces a non-tuple result be a tuple, i.e., a tuple with one node-type element with several outputs. This PR considers a return node with several outputs as a tuple to avoid errors.

Pull Request resolved: pytorch/pytorch#96936
Approved by: https://github.com/jgong5, https://github.com/jansel
@github-actions github-actions bot deleted the fix_standalone_compile branch September 17, 2024 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants