[executorch] Propagate device metadata from partitioner result onto TensorSpecs#18078
[executorch] Propagate device metadata from partitioner result onto TensorSpecs#18078Gasoonjia wants to merge 2 commits intogh/gasoonjia/135/basefrom
Conversation
…ensorSpecs Add end-to-end device type annotation support from export to runtime. Currently we only support one device per graph The overall pipeline is: a. Partitioner use `compile_spec` to determine which device the partitoned blob is runing on b. after lowered partitioned graph to backend, the new-introed propagate_device_pass will annotate the input and output tensors of delegate blob as target device. Differential Revision: [D95842511](https://our.internmc.facebook.com/intern/diff/D95842511/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18078
Note: Links to docs will display an error until the docs builds have been completed. ❌ 29 New FailuresAs of commit a86edd6 with merge base 5db6f22 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
| if lowered_module is None: | ||
| continue | ||
|
|
||
| result = _get_target_device_from_compile_specs(lowered_module) |
There was a problem hiding this comment.
This effectively assumes that we know the device 'name' AoT. In theory, we can have a multi-device delegate then the runtime might interpret this name differently and that can cause some confusion i.e cuda:0 device on Metal.
I am not sure about using generic names like 'gpu' but also not sure about following PyTorch's eager/jit style naming convention where you won't switch devices underneath.
There was a problem hiding this comment.
May I have your suggestions on the executorch device name?
Currently we set up the device name AOT and intentionally decouple dour device attribute with pytorch/pytorch device concept; we created a enum in the etensor schema for all devices we are supporting right now. In this way we can support as much as device as we want.
For the situaton you mentioned, if other backend like vulken need its own gpu device, they should add a new one to the enum. We should avoid using generic names like 'gpu'.
…sult onto TensorSpecs" Add end-to-end device type annotation support from export to runtime. Currently we only support one device per graph The overall pipeline is: a. Partitioner use `compile_spec` to determine which device the partitoned blob is runing on b. after lowered partitioned graph to backend, the new-introed propagate_device_pass will annotate the input and output tensors of delegate blob as target device. Differential Revision: [D95842511](https://our.internmc.facebook.com/intern/diff/D95842511/) [ghstack-poisoned]
Stack from ghstack (oldest at bottom):
Add end-to-end device type annotation support from export to runtime. Currently we only support one device per graph
The overall pipeline is:
a. Partitioner use
compile_specto determine which device the partitoned blob is runing onb. after lowered partitioned graph to backend, the new-introed propagate_device_pass will annotate the input and output tensors of delegate blob as target device.
Differential Revision: D95842511