[ 
https://issues.apache.org/jira/browse/MAHOUT-878?focusedWorklogId=1001274&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1001274
 ]

ASF GitHub Bot logged work on MAHOUT-878:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Jan/26 06:39
            Start Date: 22/Jan/26 06:39
    Worklog Time Spent: 10m 
      Work Description: rich7420 commented on code in PR #881:
URL: https://github.com/apache/mahout/pull/881#discussion_r2715514875


##########
qdp/qdp-core/src/lib.rs:
##########
@@ -300,6 +300,269 @@ impl QdpEngine {
             encoding_method,
         )
     }
+
+    /// Encode from existing GPU pointer (zero-copy for CUDA tensors)
+    ///
+    /// This method enables zero-copy encoding from PyTorch CUDA tensors by 
accepting
+    /// a raw GPU pointer directly, avoiding the GPU→CPU→GPU copy that would 
otherwise
+    /// be required.
+    ///
+    /// TODO: Refactor to use QuantumEncoder trait (add `encode_from_gpu_ptr` 
to trait)
+    /// to reduce duplication with AmplitudeEncoder::encode(). This would also 
make it
+    /// easier to add GPU pointer support for other encoders (angle, basis) in 
the future.
+    ///
+    /// # Arguments
+    /// * `input_d` - Device pointer to input data (f64 array on GPU)
+    /// * `input_len` - Number of f64 elements in the input
+    /// * `num_qubits` - Number of qubits for encoding
+    /// * `encoding_method` - Strategy (currently only "amplitude" supported)
+    ///
+    /// # Returns
+    /// DLPack pointer for zero-copy PyTorch integration
+    ///
+    /// # Safety
+    /// The input pointer must:
+    /// - Point to valid GPU memory on the same device as the engine
+    /// - Contain at least `input_len` f64 elements
+    /// - Remain valid for the duration of this call
+    #[cfg(target_os = "linux")]
+    pub unsafe fn encode_from_gpu_ptr(

Review Comment:
   no problem!





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1001274)
    Time Spent: 5.5h  (was: 5h 20m)

> Provide better examples for the parallel ALS recommender code
> -------------------------------------------------------------
>
>                 Key: MAHOUT-878
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-878
>             Project: Mahout
>          Issue Type: Task
>    Affects Versions: 1.0.0
>            Reporter: Sebastian Schelter
>            Assignee: Sebastian Schelter
>            Priority: Major
>             Fix For: 0.6
>
>         Attachments: MAHOUT-878.patch
>
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> We should provide examples that show how to apply the parallel ALS 
> recommender to the Netflix or KDD2011 datasets.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to