Repository navigation
[AOTI] Support mixed-device constants - #169504
desertfire wants to merge 2 commits into
Conversation
Summary: CUDA models can also contain constants (e.g. buffers) as CPU tensors. Currently AOTI doesn't consider this use case and blindly loads all weights to a single device. This PR adds the support by allowing loading constants to either the model device or CPU depending on the device type emitted at the compile time. This will become handy if we want to keep torch.cond's predicate on CPU. Weight update is not touched in this PR. It will come next. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/169504
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 3 PendingAs of commit 244f33f with merge base 76b8fda ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Summary: CUDA models can also contain constants (e.g. buffers) as CPU tensors. Currently AOTI doesn't consider this use case and blindly loads all weights to a single device. This PR adds the support by allowing loading constants to either the model device or CPU depending on the device type emitted at the compile time. This will become handy if we want to keep torch.cond's predicate on CPU. Weight update is not touched in this PR. It will come next. ghstack-source-id: 628b447 Pull Request resolved: #169504
Summary: CUDA models can also contain constants (e.g. buffers) as CPU tensors. Currently AOTI doesn't consider this use case and blindly loads all weights to a single device. This PR adds the support by allowing loading constants to either the model device or CPU depending on the device type emitted at the compile time. This will become handy if we want to keep torch.cond's predicate on CPU. Weight update is not touched in this PR. It will come next. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo [ghstack-poisoned]
Summary: CUDA models can also contain constants (e.g. buffers) as CPU tensors. Currently AOTI doesn't consider this use case and blindly loads all weights to a single device. This PR adds the support by allowing loading constants to either the model device or CPU depending on the device type emitted at the compile time. This will become handy if we want to keep torch.cond's predicate on CPU. Weight update is not touched in this PR. It will come next. ghstack-source-id: 544f504 Pull Request resolved: #169504
|
@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 |
|
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
|
@pytorchbot merge -f "skip stuck rocm CI jobs" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
Summary: CUDA models can also contain constants (e.g. buffers) as CPU tensors. Currently AOTI doesn't consider this use case and blindly loads all weights to a single device. This PR adds the support by allowing loading constants to either the model device or CPU depending on the device type emitted at the compile time. This will become handy if we want to keep torch.cond's predicate on CPU.
Weight update is not touched in this PR. It will come next.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo