refactor: move dynamo/TorchXLA bridge to pytorch/xla repo#92601
refactor: move dynamo/TorchXLA bridge to pytorch/xla repo#92601shunting314 wants to merge 1 commit intomasterfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/92601
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3e60f3b: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
JackCaoG
left a comment
There was a problem hiding this comment.
LGTM, I guess we can first try to merge the pytorch/xla pr and then merge this one? This way we don't need to deal with two way pin.
wconstab
left a comment
There was a problem hiding this comment.
lgtm.
is the main reason for leaving the dynamo integration layer in pytorch repo becuase we don't have a good backend reg api for out of tree currently? cc @SherlockNoMad i think he's working on this
|
@wconstab yea, also this is a very thin layer. Putting it in dynamo should still give us a clean code organization. |
712a816 to
519a535
Compare
519a535 to
3e60f3b
Compare
|
@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 |
) This is a follow up from the previous PR: pytorch#88449 , to move the dynamo/TorchXLA bridge from pytorch repo to xla repo. Overall the dynamo/TorchXLA integration has the following four layers of code - pybind layer: This is the bottom layer containing various pybind APIs as the foundation. This part resident in xla repo - bridge layer: build upon the pybind layer to implement the trace once functionality. This layer and it's corresponding unit test are in pytorch repro previously. This PR (and the corresponding xla pr pytorch/xla#4476 ) moves them to the xla repo. - dynamo backend registration: this a thin layer registers 4 dynamo backends (training/inference/trace_once/trace_everytime). It remains in pytorch repo. - benchmark script: the torchbench.py script in dynamo is adapted so it can be used in dynamo/TorchXLA integration. This one remains in pytorch repo. We think the new code organization is cleaner. I'll wait for the xla PR in first before trying to merge this one. Tests 1. run the unit tests moved to the xla repo 2. Test for inference: `GPU_NUM_DEVICES=1 python benchmarks/dynamo/torchbench.py --randomize-input --performance --trace-on-xla --backend=torchxla_trace_once --only resnet18` 3. Test for training: `GPU_NUM_DEVICES=1 python benchmarks/dynamo/torchbench.py --randomize-input --performance --trace-on-xla --training --backend=aot_torchxla_trace_once --only resnet18 --collect-outputs` Pull Request resolved: pytorch#92601 Approved by: https://github.com/wconstab
This is a follow up from the previous PR: #88449 , to move the dynamo/TorchXLA bridge from pytorch repo to xla repo.
Overall the dynamo/TorchXLA integration has the following four layers of code
We think the new code organization is cleaner.
I'll wait for the xla PR in first before trying to merge this one.
Tests
GPU_NUM_DEVICES=1 python benchmarks/dynamo/torchbench.py --randomize-input --performance --trace-on-xla --backend=torchxla_trace_once --only resnet18GPU_NUM_DEVICES=1 python benchmarks/dynamo/torchbench.py --randomize-input --performance --trace-on-xla --training --backend=aot_torchxla_trace_once --only resnet18 --collect-outputscc @mlazos @soumith @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @chunyuan-w @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire