-
Notifications
You must be signed in to change notification settings - Fork 984
Closed
Labels
Description
Summary
In qdp/qdp-python/src/lib.rs, the CUDA tensor device is validated in two places:
- Via PyTorch APIs in
validate_cuda_tensor_for_encoding(...), which checks that the tensor device matchesQdpEngine’s device. - Via DLPack metadata inside
extract_dlpack_tensor(...), which readsdl_tensor.device.device_idfrom theDLManagedTensor.
Currently, there is no check that these two views of the device ID are consistent. If, for any reason (framework bug, interop change, or misuse), the PyTorch-validated device ID diverges from the DLPack device_id, this could lead to hard‑to‑debug failures (e.g., using memory from the wrong device).
reference: comment
Reactions are currently unavailable