You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "400Ping (via GitHub)" <gi...@apache.org> on 2026/01/21 11:44:01 UTC

[PR] [QDP] Add Parquet streaming support for angle encoding [mahout]

400Ping opened a new pull request, #898:
URL: https://github.com/apache/mahout/pull/898

   ### Purpose of PR
   Parquet streaming encode only supports amplitude/basis today.
   Add streaming angle encoder so engine.encode("*.parquet", num_qubits, "angle") works,
   and benchmarks using mahout-parquet + angle can run without errors.
   
   ### Related Issues or PRs
   <!-- Add links to related issues or PRs. -->
   <!-- - Closes #123  -->
   <!-- - Related to #123   -->
   Closes #897 
   ### Changes Made
   <!-- Please mark one with an "x"   -->
   - [ ] Bug fix
   - [x] New feature
   - [ ] Refactoring
   - [ ] Documentation
   - [ ] Test
   - [ ] CI/CD pipeline
   - [ ] Other
   
   ### Breaking Changes
   <!-- Does this PR introduce a breaking change? -->
   - [ ] Yes
   - [x] No
   
   ### Checklist
   <!-- Please mark each item with an "x" when complete -->
   <!-- If not all items are complete, please open this as a **Draft PR**.
   Once all requirements are met, mark as ready for review. -->
   
   - [ ] Added or updated unit tests for all changes
   - [ ] Added or updated documentation for all changes
   - [ ] Successfully built and ran all unit tests or manual tests locally
   - [ ] PR title follows "MAHOUT-XXX: Brief Description" format (if related to an issue)
   - [ ] Code follows ASF guidelines
   


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

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


Re: [PR] [QDP] Add Parquet streaming support for angle encoding [mahout]

Posted by "400Ping (via GitHub)" <gi...@apache.org>.
400Ping commented on PR #898:
URL: https://github.com/apache/mahout/pull/898#issuecomment-3779908513

   Before:
   ```
   $ python benchmark/benchmark_e2e.py --frameworks all --encoding-method angle --qubits 16 --samples 1000
   Generating 1000 samples of 16 qubits...
     Generated 1000 samples
     Parquet: 0.15 MB, Arrow IPC: 0.12 MB
   
   ======================================================================
   E2E BENCHMARK: 16 Qubits, 1000 Samples
   ======================================================================
   
   [PennyLane] Full Pipeline (Disk -> GPU) - angle encoding...
     IO Time: 0.0086 s
   /home/jay/work/mahout/qdp/qdp-python/benchmark/benchmark_e2e.py:284: UserWarning: Casting complex values to real discards the imaginary part (Triggered internally at ../aten/src/ATen/native/Copy.cpp:301.)
     state_gpu = state_cpu.to("cuda", dtype=torch.float32)
     Total Time: 4.9126 s
   
   [Qiskit] Full Pipeline (Disk -> GPU) - angle encoding...
     IO Time: 0.0044 s
       Processed 40/40 vectors...
     Total Time: 38.2431 s
   
   [Mahout-Parquet] Full Pipeline (Parquet -> GPU)...
     Parquet->GPU (IO+Encode): 0.3635 s
     DLPack conversion: 0.0001 s
     Convert to float32: 0.0025 s
     Total Time: 0.3912 s
   
   [Mahout-Arrow] Full Pipeline (Arrow IPC -> GPU)...
     Arrow->GPU (IO+Encode): 0.0678 s
     DLPack conversion: 0.0001 s
     Convert to float32: 0.0002 s
     Total Time: 0.0882 s
   
   ======================================================================
   E2E LATENCY (Lower is Better)
   Samples: 1000, Qubits: 16
   ======================================================================
   Mahout-Arrow         0.0882 s
   Mahout-Parquet       0.3912 s
   PennyLane            4.9126 s
   Qiskit              38.2431 s
   ----------------------------------------------------------------------
   Speedup vs PennyLane:      55.69x
   Speedup vs Qiskit:        433.52x
   
   ======================================================================
   VERIFICATION (Mahout-Arrow vs Mahout-Parquet)
   ======================================================================
   Max Probability Difference: 1.58e-08
   Max Amplitude Difference:   1.49e-08
   >> SUCCESS: Quantum States Match!
   
   ======================================================================
   VERIFICATION (Mahout-Arrow vs PennyLane)
   ======================================================================
   Max Probability Difference: 2.64e-01
   Max Amplitude Difference:   5.14e-01
   >> FAILURE: States do not match.
   
   ======================================================================
   VERIFICATION (Mahout-Arrow vs Qiskit)
   ======================================================================
   Max Probability Difference: 8.67e-19
   Max Amplitude Difference:   2.27e-13
   >> SUCCESS: Quantum States Match!
   
   ======================================================================
   VERIFICATION (Mahout-Parquet vs PennyLane)
   ======================================================================
   Max Probability Difference: 2.64e-01
   Max Amplitude Difference:   5.14e-01
   >> FAILURE: States do not match.
   
   ======================================================================
   VERIFICATION (Mahout-Parquet vs Qiskit)
   ======================================================================
   Max Probability Difference: 1.58e-08
   Max Amplitude Difference:   1.49e-08
   >> SUCCESS: Quantum States Match!
   
   ======================================================================
   VERIFICATION (PennyLane vs Qiskit)
   ======================================================================
   Max Probability Difference: 2.64e-01
   Max Amplitude Difference:   5.14e-01
   >> FAILURE: States do not match.
   ```
   
   After:
   ```
   $ python benchmark/benchmark_e2e.py --frameworks all --encoding-method angle --qubits 16 --samples 1000
   Generating 1000 samples of 16 qubits...
     Generated 1000 samples
     Parquet: 0.15 MB, Arrow IPC: 0.12 MB
   
   ======================================================================
   E2E BENCHMARK: 16 Qubits, 1000 Samples
   ======================================================================
   
   [PennyLane] Full Pipeline (Disk -> GPU) - angle encoding...
     IO Time: 0.0077 s
   /home/jay/work/mahout/qdp/qdp-python/benchmark/benchmark_e2e.py:284: UserWarning: Casting complex values to real discards the imaginary part (Triggered internally at ../aten/src/ATen/native/Copy.cpp:301.)
     state_gpu = state_cpu.to("cuda", dtype=torch.float32)
     Total Time: 4.7231 s
   
   [Qiskit] Full Pipeline (Disk -> GPU) - angle encoding...
     IO Time: 0.0044 s
       Processed 40/40 vectors...
     Total Time: 38.1054 s
   
   [Mahout-Parquet] Full Pipeline (Parquet -> GPU)...
     Parquet->GPU (IO+Encode): 0.3767 s
     DLPack conversion: 0.0001 s
     Convert to float32: 0.0023 s
     Total Time: 0.4043 s
   
   [Mahout-Arrow] Full Pipeline (Arrow IPC -> GPU)...
     Arrow->GPU (IO+Encode): 0.0678 s
     DLPack conversion: 0.0001 s
     Convert to float32: 0.0002 s
     Total Time: 0.0882 s
   
   ======================================================================
   E2E LATENCY (Lower is Better)
   Samples: 1000, Qubits: 16
   ======================================================================
   Mahout-Arrow         0.0882 s
   Mahout-Parquet       0.4043 s
   PennyLane            4.7231 s
   Qiskit              38.1054 s
   ----------------------------------------------------------------------
   Speedup vs PennyLane:      53.55x
   Speedup vs Qiskit:        432.07x
   
   ======================================================================
   VERIFICATION (Mahout-Arrow vs Mahout-Parquet)
   ======================================================================
   Max Probability Difference: 1.58e-08
   Max Amplitude Difference:   1.49e-08
   >> SUCCESS: Quantum States Match!
   
   ======================================================================
   VERIFICATION (Mahout-Arrow vs PennyLane)
   ======================================================================
   Max Probability Difference: 2.64e-01
   Max Amplitude Difference:   5.14e-01
   >> FAILURE: States do not match.
   
   ======================================================================
   VERIFICATION (Mahout-Arrow vs Qiskit)
   ======================================================================
   Max Probability Difference: 8.67e-19
   Max Amplitude Difference:   2.27e-13
   >> SUCCESS: Quantum States Match!
   
   ======================================================================
   VERIFICATION (Mahout-Parquet vs PennyLane)
   ======================================================================
   Max Probability Difference: 2.64e-01
   Max Amplitude Difference:   5.14e-01
   >> FAILURE: States do not match.
   
   ======================================================================
   VERIFICATION (Mahout-Parquet vs Qiskit)
   ======================================================================
   Max Probability Difference: 1.58e-08
   Max Amplitude Difference:   1.49e-08
   >> SUCCESS: Quantum States Match!
   
   ======================================================================
   VERIFICATION (PennyLane vs Qiskit)
   ======================================================================
   Max Probability Difference: 2.64e-01
   Max Amplitude Difference:   5.14e-01
   >> FAILURE: States do not match.
   ```


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

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


Re: [PR] [QDP] Add Parquet streaming support for angle encoding [mahout]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #898:
URL: https://github.com/apache/mahout/pull/898#issuecomment-3782368196

   LGTM


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

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


Re: [PR] [QDP] Add Parquet streaming support for angle encoding [mahout]

Posted by "400Ping (via GitHub)" <gi...@apache.org>.
400Ping commented on PR #898:
URL: https://github.com/apache/mahout/pull/898#issuecomment-3777661882

   cc @guan404ming @ryankert01 @rich7420 


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

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


Re: [PR] [QDP] Add Parquet streaming support for angle encoding [mahout]

Posted by "ryankert01 (via GitHub)" <gi...@apache.org>.
ryankert01 commented on PR #898:
URL: https://github.com/apache/mahout/pull/898#issuecomment-3778331178

   if possible, please include benchmark result in the pr description! (as you've run it)
   That's helpful for me.


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

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


Re: [PR] [QDP] Add Parquet streaming support for angle encoding [mahout]

Posted by "400Ping (via GitHub)" <gi...@apache.org>.
400Ping commented on PR #898:
URL: https://github.com/apache/mahout/pull/898#issuecomment-3779931396

   Before:
   ```
   $ python benchmark/benchmark_e2e.py   --frameworks mahout-parquet   --encoding-method angle   --qubits 16   --samples 1000
   Generating 1000 samples of 16 qubits...
     Generated 1000 samples
     Parquet: 0.15 MB, Arrow IPC: 0.12 MB
   
   ======================================================================
   E2E BENCHMARK: 16 Qubits, 1000 Samples
   ======================================================================
   
   [Mahout-Parquet] Full Pipeline (Parquet -> GPU)...
     Parquet->GPU (IO+Encode): 0.3926 s
     DLPack conversion: 0.0001 s
     Convert to float32: 0.0091 s
     Total Time: 0.4378 s
   
   ======================================================================
   E2E LATENCY (Lower is Better)
   Samples: 1000, Qubits: 16
   ======================================================================
   Mahout-Parquet       0.4378 s
   ----------------------------------------------------------------------
   ```
   
   After:
   ```
   $ python benchmark/benchmark_e2e.py   --frameworks mahout-parquet   --encoding-method angle   --qubits 16   --samples 1000
   Generating 1000 samples of 16 qubits...
     Generated 1000 samples
     Parquet: 0.15 MB, Arrow IPC: 0.12 MB
   
   ======================================================================
   E2E BENCHMARK: 16 Qubits, 1000 Samples
   ======================================================================
   
   [Mahout-Parquet] Full Pipeline (Parquet -> GPU)...
     Parquet->GPU (IO+Encode): 0.3792 s
     DLPack conversion: 0.0001 s
     Convert to float32: 0.0102 s
     Total Time: 0.4260 s
   
   ======================================================================
   E2E LATENCY (Lower is Better)
   Samples: 1000, Qubits: 16
   ======================================================================
   Mahout-Parquet       0.4260 s
   ----------------------------------------------------------------------
   ```


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

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


Re: [PR] [QDP] Add Parquet streaming support for angle encoding [mahout]

Posted by "guan404ming (via GitHub)" <gi...@apache.org>.
guan404ming merged PR #898:
URL: https://github.com/apache/mahout/pull/898


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

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


Re: [PR] [QDP] Add Parquet streaming support for angle encoding [mahout]

Posted by "400Ping (via GitHub)" <gi...@apache.org>.
400Ping commented on PR #898:
URL: https://github.com/apache/mahout/pull/898#issuecomment-3778783222

   > if possible, please include benchmark result in the pr description! (as you've run it) That's helpful for me.
   
   We should merge this https://github.com/apache/mahout/pull/894 first to better test this


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

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