Skip to content

Add standalone torch._inductor.compile() API#95594

Closed
jansel wants to merge 3 commits intogh/jansel/61/basefrom
gh/jansel/61/head
Closed

Add standalone torch._inductor.compile() API#95594
jansel wants to merge 3 commits intogh/jansel/61/basefrom
gh/jansel/61/head

Conversation

@jansel
Copy link
Contributor

@jansel jansel commented Feb 27, 2023

This fixes support for inductor compiling non-dynamo generated FX graphs.

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 27, 2023

🔗 Helpful Links

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

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

✅ No Failures

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

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

jansel added a commit that referenced this pull request Feb 27, 2023
This fixes support for inductor compiling non-dynamo generated FX graphs.

ghstack-source-id: af22b91
Pull Request resolved: #95594
@jansel jansel added the topic: not user facing topic category label Feb 27, 2023
Copy link
Contributor

@bertmaher bertmaher left a comment

Choose a reason for hiding this comment

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

Cool, thanks for doing this!

Copy link
Contributor

@desertfire desertfire left a comment

Choose a reason for hiding this comment

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

This would also benefit AOT Inductor. Thanks!

@jansel jansel added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 27, 2023
@jansel
Copy link
Contributor Author

jansel commented Feb 27, 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: Command git -C /home/runner/work/pytorch/pytorch rebase origin/master returned non-zero exit code 1

Rebasing (1/1)
Auto-merging torch/_inductor/compile_fx.py
CONFLICT (content): Merge conflict in torch/_inductor/compile_fx.py
error: could not apply bc10df638a1... Add standalone torch._inductor.compile() API (#95594)
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply bc10df638a1... Add standalone torch._inductor.compile() API (#95594)
Details for Dev Infra team Raised by workflow job

This fixes support for inductor compiling non-dynamo generated FX graphs.

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

[ghstack-poisoned]
jansel added a commit that referenced this pull request Feb 27, 2023
This fixes support for inductor compiling non-dynamo generated FX graphs.

ghstack-source-id: 9bb346d
Pull Request resolved: #95594
@jansel
Copy link
Contributor Author

jansel commented Feb 27, 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

The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot.

@jansel
Copy link
Contributor Author

jansel commented Feb 28, 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

The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot.

This fixes support for inductor compiling non-dynamo generated FX graphs.

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

[ghstack-poisoned]
jansel added a commit that referenced this pull request Feb 28, 2023
This fixes support for inductor compiling non-dynamo generated FX graphs.

ghstack-source-id: b59902c
Pull Request resolved: #95594
@jansel
Copy link
Contributor Author

jansel commented Feb 28, 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 2, 2023
This fixes support for inductor compiling non-dynamo generated FX graphs.

Pull Request resolved: pytorch/pytorch#95594
Approved by: https://github.com/bertmaher, https://github.com/desertfire
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 5, 2023
This fixes support for inductor compiling non-dynamo generated FX graphs.

Pull Request resolved: pytorch/pytorch#95594
Approved by: https://github.com/bertmaher, https://github.com/desertfire
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 5, 2023
This fixes support for inductor compiling non-dynamo generated FX graphs.

Pull Request resolved: pytorch/pytorch#95594
Approved by: https://github.com/bertmaher, https://github.com/desertfire
pytorchmergebot pushed a commit that referenced this pull request Mar 19, 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: #96936
Approved by: https://github.com/jgong5, https://github.com/jansel
pytorchmergebot pushed a commit that referenced this pull request Mar 20, 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: #96936
Approved by: https://github.com/jgong5, https://github.com/jansel
pruthvistony added a commit to ROCm/pytorch that referenced this pull request May 2, 2023
@facebook-github-bot facebook-github-bot deleted the gh/jansel/61/head branch June 8, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants