Skip to content

Perf/inner product fused kernel#111

Open
Praz314159 wants to merge 2 commits into
compsec-epfl:mainfrom
Praz314159:perf/inner-product-fused-kernel
Open

Perf/inner product fused kernel#111
Praz314159 wants to merge 2 commits into
compsec-epfl:mainfrom
Praz314159:perf/inner-product-fused-kernel

Conversation

@Praz314159

@Praz314159 Praz314159 commented Jul 2, 2026

Copy link
Copy Markdown

##Summary

Two small performance fixes to the per-round hot paths. All tests pass unchanged.

  1. InnerProductProver::round now delegates to the fused kernel
  2. shrink_to_fit removed from the remaining per-round folds, aligning with documented policy. At 2^24 the realloc was costing ~33% of the fold.

Performance

Apple M-series (aarch64/NEON), default features, cargo bench --bench sumcheck, criterion. Baseline = current main (9e55dc3).

bench size main this PR change
inner_product/F64 2^20 4.43 ms 2.12 ms −52%
inner_product/F64 2^24 66.3 ms 21.7 ms −67% (3.05×)
inner_product/F64Ext3 2^16 2.57 ms 1.17 ms −54%
inner_product/F64Ext3 2^20 34.6 ms 9.97 ms −72%
inner_product/F64Ext3 2^24 542 ms 140 ms −74% (3.9×)
fold/F64 2^20 597 µs 532 µs −8%
fold/F64 2^24 13.9 ms 9.63 ms −33% (1.5×)

Notes:
A single fold pass over 2^24 (13.9 ms) was slower than an entire 24-round multilinear sumcheck (9.8 ms) — the shrink realloc, not the arithmetic, was the cost.

Verification

cargo test --all-features (128 tests, includes the adversarial verifier suite and legacy equality tests), cargo clippy --all-features -- -D warnings, cargo fmt --check — all

The fused inner-product path already documents that a realloc per round
is pricier than the capacity we carry; apply the same policy to the
remaining fold sites.
round() previously did two separate fold passes plus a serial compute
loop. Delegate to fused_fold_and_compute_polynomial and
compute_sumcheck_polynomial (rayon-parallel, one pass), mirroring
MultilinearProver. Wire format is unchanged.
@Praz314159 Praz314159 marked this pull request as draft July 2, 2026 11:47
@Praz314159 Praz314159 marked this pull request as ready for review July 2, 2026 11:48
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.

1 participant