400Ping opened a new pull request, #774:
URL: https://github.com/apache/mahout/pull/774
### Purpose of PR
<!-- Describe what this PR does. -->
DLPack output was coming back as a flat 1-D tensor (`n_samples *
2^n_qubits`), so the benchmark assert expected 2-D `[n_samples, state_len]` was
failing. Added a defensive reshape to view the tensor as `[n_samples,
state_len]` before asserting, so benchmarks can continue even when the producer
flattens the DLPack shape.
Error log:
```
$ python ./benchmark/benchmark_e2e.py --frameworks all --samples 1000
Generating 1000 samples of 16 qubits...
Generated 1000 samples
Parquet: 500.34 MB, Arrow IPC: 500.00 MB
======================================================================
E2E BENCHMARK: 16 Qubits, 1000 Samples
======================================================================
[PennyLane] Full Pipeline (Disk -> GPU)...
IO Time: 0.9895 s
/home/jay/work/mahout/qdp/./benchmark/benchmark_e2e.py:237: UserWarning:
Casting complex values to real discards the imaginary part (Triggered
internally at /pytorch/aten/src/ATen/native/Copy.cpp:309.)
state_gpu = state_cpu.to("cuda", dtype=torch.float32)
Total Time: 1.4611 s
[Qiskit] Full Pipeline (Disk -> GPU)...
IO Time: 0.9268 s
Processed 40/40 vectors...
Total Time: 68.6920 s
[Mahout-Parquet] Full Pipeline (Parquet -> GPU)...
Parquet->GPU (IO+Encode): 0.7504 s
DLPack conversion: 0.0001 s
Traceback (most recent call last):
File "/home/jay/work/mahout/qdp/./benchmark/benchmark_e2e.py", line 450,
in <module>
t_mahout_parquet, mahout_parquet_all_states = run_mahout_parquet(
^^^^^^^^^^^^^^^^^^^
File "/home/jay/work/mahout/qdp/./benchmark/benchmark_e2e.py", line 282,
in run_mahout_parquet
assert gpu_batched.shape == (n_samples, state_len), (
```
### Related Issues or PRs
<!-- Add links to related issues or PRs. -->
<!-- - Closes #123 -->
<!-- - Related to #123 -->
Closes #759
### Changes Made
<!-- Please mark one with an "x" -->
- [x] Bug fix
- [ ] 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]