Open MengqingCao opened 1 month ago
I think this is an extremely useful feature to add...!
I think this is an extremely useful feature to add...!
Thanks for your approval, Iā ll do this work and submit a PR soon
ah ok great.. Create a comment here and I will checkout the PR :)
š Feature
--device
arg to determine the backend, and modify the hard code related to cuda to accelerator.torch-npu
adapter.Motivation & Examples
Currently, PyTorch supports many accelerators besides NVIDIA GPU, e.g., XLA devices (like TPUs), XPU, MPS and Ascend NPU. Adding a
--device
argument for users to specify the accelerator they would like to use is helpful. If this is acceptable for community, I would like to do this work.Moreover, on the basis of
device
arg, I would like to add support for Ascend NPU backend for detectron2.A tiny example The modify of
_distributed_worker
func:Related Info
torch.device : https://pytorch.org/docs/stable/tensor_attributes.html#torch-device
torch Praviteuse1 (Registering new backend module to Pytorch) : https://pytorch.org/tutorials/advanced/privateuseone.html