Skip to content

feat: add IQP / IQP-Z latency and throughput benchmark#1257

Open
viiccwen wants to merge 3 commits intoapache:mainfrom
viiccwen:feature/iqp-encoding-benchmark
Open

feat: add IQP / IQP-Z latency and throughput benchmark#1257
viiccwen wants to merge 3 commits intoapache:mainfrom
viiccwen:feature/iqp-encoding-benchmark

Conversation

@viiccwen
Copy link
Copy Markdown
Contributor

@viiccwen viiccwen commented Apr 11, 2026

Related Issues

Closes #1256

Changes

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • Test
  • CI/CD pipeline
  • Other

Why

QDP already supports iqp and iqp-z in the encoding engine, but the standard latency / throughput benchmark path did not. The Rust synthetic pipeline still treated those runs like amplitude-shaped inputs, and the Python benchmark layer did not expose or document the IQP-family options clearly.

This meant users could not benchmark IQP-family encodings through the same benchmark API/scripts used for amplitude.

How

  • updated qdp-core synthetic benchmark sizing so:
    • iqp-z uses num_qubits
    • iqp uses num_qubits + num_qubits * (num_qubits - 1) / 2
  • generated deterministic IQP-family phase parameters in the Rust and Python synthetic benchmark helpers
  • added iqp / iqp-z support to:
    • benchmark_latency.py
    • benchmark_throughput.py
    • benchmark_pytorch_ref.py
  • extended the PyTorch fallback path to accept iqp-z
  • added Rust and Python tests covering:
    • pipeline vector sizing
    • deterministic IQP-family sample generation
    • fallback benchmark execution
  • updated benchmark and Python API documentation

NOTICED: Due to #1252, we only can testing Mahout IQP/IQP-Z, using TODO label and warning to fix it in the future.

Results

Generating 12800 samples of 16 qubits...
  Batch size   : 64
  Vector length: 136
  Batches      : 200
  Prefetch     : 16
  Frameworks   : mahout
  Encode method: iqp
  Generated 12800 samples
  PennyLane/Qiskit format: 13.28 MB
  Mahout format: 13.28 MB

======================================================================
DATA-TO-STATE LATENCY BENCHMARK: 16 Qubits, 12800 Samples
======================================================================

[Mahout] Full Pipeline (DataLoader -> GPU)...
  Total Time: 0.5072 s (0.040 ms/vector)

======================================================================
LATENCY (Lower is Better)
Samples: 12800, Qubits: 16
======================================================================
Mahout                  0.040 ms/vector
----------------------------------------------------------------------

Checklist

  • Added or updated unit tests for all changes
  • Added or updated documentation for all changes

Copy link
Copy Markdown
Member

@400Ping 400Ping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM

@400Ping
Copy link
Copy Markdown
Member

400Ping commented Apr 12, 2026

Note that I only did a quick scan for this PR, a little busy this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add IQP / IQP-Z support to QDP benchmark latency / throughput pipelines

2 participants