You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by "viiccwen (via GitHub)" <gi...@apache.org> on 2026/04/13 05:45:49 UTC
[PR] [Feature] Add batch float32 zero-copy angle encoding in qdp-core [mahout]
viiccwen opened a new pull request, #1268:
URL: https://github.com/apache/mahout/pull/1268
### Related Issues
- Closes #1267
### Changes
- [ ] Bug fix
- [x] New feature
- [ ] Refactoring
- [ ] Documentation
- [x] Test
- [ ] CI/CD pipeline
- [ ] Other
- add batched float32 CUDA kernel support for angle encoding
- expose the new kernel through `qdp-kernels` FFI
- implement host-side angle batch float32 encoding in `qdp-core`
- add zero-copy batch float32 angle APIs for CUDA pointers, including stream-aware variants
- align float32 GPU-pointer validation with the existing float64 angle batch behavior
- add kernel and core tests for success paths and failure paths
### Why
QDP already had angle float32 zero-copy support for single samples, but not for batched angle features. That made batched angle workloads inconsistent with the existing single-sample API and with the amplitude float32 batch implementation pattern.
This change closes that gap in the Rust/CUDA core only. Python bindings remain out of scope for a follow-up PR.
### How
- implement `launch_angle_encode_batch_f32` in `qdp-kernels/src/angle.cu`
- add the corresponding extern declaration and non-CUDA stub in `qdp-kernels/src/lib.rs`
- extend `AngleEncoder` with host-side batch float32 encoding and batch GPU-pointer float32 encoding
- add public `QdpEngine` entry points for angle batch float32 zero-copy on the default stream and explicit streams
- validate sample shape and reject non-finite float32 GPU-resident batch inputs before launching the encoding kernel
- add tests covering kernel correctness, host-side batch encoding, zero-copy batch encoding, stream interop, error handling, and Float64-engine conversion
## Checklist
- [x] Added or updated unit tests for all changes
- [ ] Added or updated documentation for all changes
--
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: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add batch float32 zero-copy angle encoding in qdp-core [mahout]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 merged PR #1268:
URL: https://github.com/apache/mahout/pull/1268
--
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: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add batch float32 zero-copy angle encoding in qdp-core [mahout]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #1268:
URL: https://github.com/apache/mahout/pull/1268#issuecomment-4286477245
@viiccwen thanks for the patch!
--
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: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add batch float32 zero-copy angle encoding in qdp-core [mahout]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on code in PR #1268:
URL: https://github.com/apache/mahout/pull/1268#discussion_r3110974701
##########
qdp/qdp-core/src/lib.rs:
##########
@@ -768,6 +768,78 @@ impl QdpEngine {
Ok(batch_state_vector.to_dlpack())
}
+ /// Encode an angle batch from an existing GPU pointer (float32 input only).
+ ///
+ /// Zero-copy batch encoding from CUDA float32 tensors. Uses the default CUDA stream.
+ /// For stream interop use `encode_angle_batch_from_gpu_ptr_f32_with_stream`.
Review Comment:
nit: doc should mention that output precision follows the engine's configured precision, not necessarily f32 — F64 engine + F32 input yields complex128. Don't want downstream folks tripping on the DLPack dtype.
--
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: commits-unsubscribe@mahout.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org