Skip to content

GKR performance: tracking issue #52

Open

Description

@xrvdg

Overview of the performance work on the GKR prover: gkr_reduce in the prover and verifier, and crates/gkr. Part of #41.

Benchmark

cargo bench -p prover --bench prover -- gkr, shape (10, 15), M3 Pro (5 performance + 6 efficiency cores).

State All threads One thread
Before #55 363 ms 480 ms
#55 166 ms 283 ms
Pre-#146 main 115 ms 215 ms
#146 68 ms 158 ms

All numbers are medians. The last two rows were measured on 2026-10-22. For one thread, #55 used single_threaded.patch and the later rows RAYON_NUM_THREADS=1.

Done

  • Grand product GKR: core structure #40: Core structure of the grand product GKR.
  • GKR integration #49: GKR integrated into the prover and verifier. Removed the deallocations and the deque from the prove layer. Replaced the m-table with a factored claim discharged through the PCS.
  • GKR: benchmark and profiling setup + improvements #55: Benchmark and profiling setup: divan bench, profiling example, and single_threaded.patch. Also:
    • transposed the bit table before leaf construction, so the walk is sequential;
    • fixed the exponential over-allocation in SuffixTable::new;
    • made the m-table accumulation branchless;
    • zeroed vectors with bytemuck's zeroed_vec.
  • GKR: Second optimisation set #60: Second pass over the round loop:
    • SuffixTable flattened into one preallocated buffer, reused across layers;
    • batched_eval consumes the circuit instead of cloning the leaves;
    • eq_factor inlined in closed form;
    • rayon fold replaced by 2-wide interleaved PMULL chains, with a fused multiply-reduce in mul3_wide;
    • layer sumcheck chunked to reduce variance.
  • Separate Bit Transpose from Bittable #137: Separated the bit transpose from BitTable. BitTable stays the protocol's view of the witness, and BitMatrix does the bit operations. The witness is read as u128 words.
  • GKR: lookup tables and bucketing #146: Lookup tables and bucketing for the bottom three layers (also closed Generate GKR product forests with lazy L2/L4/L8 storage #107 and Parallelize forest construction and select public lazy schedules #116):
    • Layers 0–2 (the leaves and the two layers above them) are never built. Their nodes come from 16-entry lookup tables indexed by nibbles of the transposed bits.
    • Round 1 of the sumchecks of layers 0–2 reads the nibbles and the lookup tables directly.
    • The lookup tables, layer 3 and the layers above it are built in parallel.
    • Round 1 of the leaves and of layer 1 splits eq into eq_hi · eq_lo.

No longer applies

In progress

To do

Follow-ups to #146

At (10, 15) on all threads, about 25 of the 68 ms run on a single thread. Removing that would bring the bench to about 43 ms.

Remaining BitZ-PoC ports (trimmed to active high-leverage items)

(Completed by #146: #107, #116. Closed as premature / PoC-layout-specific / low-priority experiments: #111, #113, #114, #115, #117, #128, #129.)

Related

Activity

  1. xrvdg commented on Sep 11, 2026

    @xrvdg
    CollaboratorAuthor

    #55

    ┌───────────────────────────┬──────────┬──────────┬─────────┐
    │                           │  before  │  after   │ speedup │
    ├───────────────────────────┼──────────┼──────────┼─────────┤
    │ parallel (default)        │ 363.4 ms │ 166.1 ms │ 2.19x   │
    ├───────────────────────────┼──────────┼──────────┼─────────┤
    │ single-threaded (patched) │ 480.3 ms │ 283.4 ms │ 1.70x   │
    └───────────────────────────┴──────────┴──────────┴─────────┘
    
  2. zkfriendly commented on Nov 24, 2026

    @zkfriendly
    Collaborator

    Updated tracker against main (34addac): moved merged #137 and #146 to Done, added open PR #152 (resolving #58) under In progress, updated partial-progress notes for #107/#108/#116, and linked #143 and #144.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions