Skip to content

feat: implement IQP encoding benchmark and reference against Torch#1231

Draft
vvvdwbvvv wants to merge 1 commit into
apache:mainfrom
vvvdwbvvv:feat/kernel-parity-torch-compile
Draft

feat: implement IQP encoding benchmark and reference against Torch#1231
vvvdwbvvv wants to merge 1 commit into
apache:mainfrom
vvvdwbvvv:feat/kernel-parity-torch-compile

Conversation

@vvvdwbvvv

@vvvdwbvvv vvvdwbvvv commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Related Issues

#1227

Changes

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

Why

This change is the first stage of the IQP kernel roadmap toward matching or exceeding the torch.compile reference implementation. We need a reliable torch reference for IQP behavior, stronger hard-case numerical coverage, and a benchmark that makes CUDA-vs-torch parity measurable before deeper kernel optimization work.

How

  • added a reusable torch IQP reference implementation for both iqp and iqp-z
  • added an IQP benchmark comparing QDP CUDA, eager torch, and torch.compile
  • added Python GPU correctness tests with hard single-sample, batch, and IQP-Z cases
  • strengthened Rust IQP integration tests around FWT-path and hard-case coverage
  • updated benchmark utilities and docs for IQP / IQP-Z support
  • adjusted qumat_qdp imports so pure-Python helpers remain importable when _qdp is not built

Checklist

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

@vvvdwbvvv

Copy link
Copy Markdown
Contributor Author

This PR is bigger, feel free to suggest.

@ryankert01

Copy link
Copy Markdown
Member

Duplicated with #1189

@ryankert01

Copy link
Copy Markdown
Member

Feel free to reopen it if otherwise

@ryankert01 ryankert01 closed this Mar 30, 2026
@vvvdwbvvv

Copy link
Copy Markdown
Contributor Author

Okay I'll do phase encoding!

@ryankert01

Copy link
Copy Markdown
Member

@vvvdwbvvv Please do it after my PR get merged! Thanks!

@400Ping

400Ping commented Apr 12, 2026

Copy link
Copy Markdown
Member

@vvvdwbvvv @ryankert01 's PR has been merge. I will help reopen this

@400Ping 400Ping reopened this Apr 12, 2026
@vvvdwbvvv

Copy link
Copy Markdown
Contributor Author

Alr, Got it! Will continue to finish it.

@ryankert01 ryankert01 marked this pull request as draft April 21, 2026 17:14
@ryankert01

Copy link
Copy Markdown
Member

draft it to avoid early review. also I suggest to have a fresh start instead.

@rich7420

rich7420 commented May 12, 2026

Copy link
Copy Markdown
Contributor

hey @vvvdwbvvv — i think your iqp torch reference here will be useful for something i'm planning.

a plan.lower("pennylane") lowering layer in qdp (~2 months out) would diff iqp-encoded states against a known-good torch reference for correctness — and yours in #1231 fits that exactly.

no urgency, no pressure. just a heads-up so we can coordinate signatures when you're ready to leave draft. a ping then would be appreciated.

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.

4 participants