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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]