You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mahout.apache.org by "viiccwen (via GitHub)" <gi...@apache.org> on 2026/02/02 16:22:30 UTC

[I] [QDP] Add zero-copy angle encoding from float32 GPU tensors [mahout]

viiccwen opened a new issue, #1003:
URL: https://github.com/apache/mahout/issues/1003

   ### Summary
   Extend QDP to support zero-copy angle encoding from float32 GPU pointers (e.g. PyTorch `torch.float32` CUDA tensors).
   
   - **Amplitude encoding** already has dedicated zero-copy APIs for float32 GPU input: `QdpEngine::encode_from_gpu_ptr_f32` and `encode_from_gpu_ptr_f32_with_stream`. The Python bindings use these when the user passes a CUDA float32 tensor for amplitude encoding, avoiding host round-trips.
   - **Angle encoding** currently uses the generic `encode_from_gpu_ptr` / `encode_from_gpu_ptr_with_stream` path, which interprets the pointer as **float64**. When the user passes a float32 CUDA tensor for angle encoding, the current behavior is to fall back to CPU (e.g. “only supports 'amplitude', 'angle', or 'basis' methods … Use tensor.cpu()”), forcing a device-to-host copy and losing zero-copy benefits.
   


-- 
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: issues-unsubscribe@mahout.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [QDP] Add zero-copy angle encoding from float32 GPU tensors [mahout]

Posted by "alisha-1000 (via GitHub)" <gi...@apache.org>.
alisha-1000 commented on issue #1003:
URL: https://github.com/apache/mahout/issues/1003#issuecomment-3939387314

   Hi @viiccwen,
   
   I’d like to work on adding zero-copy float32 GPU support for angle encoding.
   
   From the description, it seems amplitude encoding already provides specialized APIs (encode_from_gpu_ptr_f32 and _with_stream) that avoid host round-trips when given torch.float32 CUDA tensors.
   
   For angle encoding, I propose:
   
   Adding encode_from_gpu_ptr_f32 variants for angle encoding in QdpEngine
   
   Implementing corresponding CUDA kernel handling float32 input
   
   Updating Python bindings to dispatch based on:
   
   device (CUDA vs CPU)
   
   dtype (float32 vs float64)
   
   Ensuring no fallback to CPU occurs when a torch.float32 CUDA tensor is provided
   
   Before starting, I’d like to confirm:
   
   Should angle encoding maintain float32 internally, or upcast to float64 inside the kernel?
   
   Are there precision expectations (e.g. fidelity thresholds) we should preserve compared to the current float64 path?
   
   I’ll review the amplitude encoding implementation as the architectural reference and keep the API consistent.


-- 
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: issues-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [QDP] Add zero-copy angle encoding from float32 GPU tensors [mahout]

Posted by "viiccwen (via GitHub)" <gi...@apache.org>.
viiccwen closed issue #1003: [QDP] Add zero-copy angle encoding from float32 GPU tensors
URL: https://github.com/apache/mahout/issues/1003


-- 
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: issues-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [QDP] Add zero-copy angle encoding from float32 GPU tensors [mahout]

Posted by "viiccwen (via GitHub)" <gi...@apache.org>.
viiccwen commented on issue #1003:
URL: https://github.com/apache/mahout/issues/1003#issuecomment-4950360665

   Closed, already done.


-- 
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: issues-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org