zihaomu commented on code in PR #585:
URL: https://github.com/apache/tvm-ffi/pull/585#discussion_r3226427075
##########
python/tvm_ffi/_optional_torch_c_dlpack.py:
##########
@@ -94,7 +105,7 @@ def load_torch_c_dlpack_extension() -> Any: # noqa:
PLR0912, PLR0915
import torch # noqa: PLC0415
import torch.version # noqa: PLC0415
- prefer_rocm_override = bool(torch.cuda.is_available() and
torch.version.hip is not None)
+ prefer_rocm_override = _torch_extension_device(torch) == "rocm"
Review Comment:
Hi @tqchen. I checked
[pytorch/pytorch#175432](https://github.com/pytorch/pytorch/pull/175432#issuecomment-3936901860).
It was closed because the author confirmed that the new hipify tool should
handle this automatically. I also verified with
torch==2.13.0.dev20260428+rocm7.2 that
PyTorch's built-in DLPack exchange API returns the expected current HIP
stream.
So this PR no longer tries to solve the upstream PyTorch hipify issue.
Instead, it removes the ROCm-specific local override and lets tvm-ffi use
PyTorch's built-in DLPack API when available.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]