refactor: move dynamo/TorchXLA bridge to pytorch/xla repo#4476
refactor: move dynamo/TorchXLA bridge to pytorch/xla repo#4476
Conversation
|
@JackCaoG should I be worried about the CI break?
|
|
I just restarted the CI, let's see how it goes. I think you also want to update the test under |
d971fa3 to
cb857fb
Compare
|
Looks like the exsting tests under test/dynamo does not refer to the bridge directly. They specify the backend by string name which is not affected by the refactoring. |
|
should I review the code in this PR as if it is just a code move from pytorch/pytorch or is there also some significant change to the code? |
|
@wconstab there is no significant change. Just some code movements and some necessary renames. |
|
Thanks Shutning, I will try to take a look tmr. |
JackCaoG
left a comment
There was a problem hiding this comment.
Mostly LGTM, thanks Shunting!
cb857fb to
2248d46
Compare
JackCaoG
left a comment
There was a problem hiding this comment.
Let's fix the linter then we can merge this one. Thanks @shunting314 !
2248d46 to
dcf7a0f
Compare
|
@JackCaoG any good way for me to fix the lint errors? How do you guys fix lint errors? Any more efficient ways? (hopefully there is some script to do that locally?) |
dcf7a0f to
969f39b
Compare
|
failure is unrealted, merging |
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 - 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: #92601 Approved by: https://github.com/wconstab
) 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
Check the pytorch side PR for details: pytorch/pytorch#92601 .
The pytorch one needs to wait for this one to be merged first.