Skip to content

Parallelize forest construction and select public lazy schedules #116

Done

Description

@wu-s-john

The target builds successive product layers serially. Once lazy storage exists, the fastest schedule also depends on public shape, worker count and hardware; deepest laziness is not uniformly best.

This issue owns parallel independent tree/table construction and a deterministic auto policy for choosing among implemented schedules.

Sources

The target repository's existing relation, field encoding, coordinate order, and transcript contracts are authoritative. The current target implementation determines compatibility; the PoC implementation is reference-only and must be re-derived against those contracts.

In scope

  • Parallelize disjoint tree/table jobs while preserving logical order and reusing the configured thread pool; apply size gates to avoid tiny-job overhead.
  • Provide forced L2/L4/L8 and auto modes, validate unsupported depth/path combinations, and record chosen schedule in benchmark metadata.
  • Derive auto choices solely from public geometry/platform/worker count and matched measurements. Separate construction scheduling from the pool-sizing issue Size the rayon pool to the performance cores #48.

Out of scope: adding lazy algorithms themselves, changing GKR messages, dynamic private-value scheduling policy, or creating nested global pools.

Potential impact

Parallel construction can reduce setup/prover latency, while schedule selection trades retained layers against regeneration. The PoC records some Apple L8 cases costing 19–37% more time for about 19% less RSS; those are within-PoC observations, not target baselines. Prefer measured tradeoffs to maximum laziness.

Done when

  • Serial/parallel and all eligible schedules produce identical layers, roots, proof/transcript bytes and terminal claims.
  • Test worker counts including one, tall/wide/shallow shapes, invalid overrides and checked geometry; tampered messages/openings remain rejected.
  • No race, duplicate work or stale scratch ownership appears under concurrent jobs; unsupported architectures retain a valid conservative policy.
  • Publish matched construction/prove/RSS/allocation results for forced schedules and auto, separating scheduler gains from hardware and protocol changes.

Dependencies and coordination

Depends on #107. Coordinate with #52, #48. The GKR tracker #52 tracks the wider programme; this issue owns only the scoped implementation above.

Activity

  1. added
    enhancement
    difficulty: hard
    gkr
    optimization-port
    parallelism
    scheduling
    urgency: high
    on Sep 24, 2026
  2. zkfriendly commented on Nov 24, 2026

    @zkfriendly
    Collaborator

    Status update (main 34addac): partially implemented by #146 (f433296). lower_luts, layer3, and fold_layers in crates/gkr/src/lib.rs are now parallelized with Rayon. Remaining scope: parallelizing BitMatrix::transpose (crates/common/src/matrix.rs, ~2.1 ms serial) and auto-selecting lazy schedules once #107 supports multiple schedules.

  3. zkfriendly commented on Nov 24, 2026

    @zkfriendly
    Collaborator

    Closing as substantially completed by #146 (f433296), which parallelized lower_luts, layer3, and fold_layers in crates/gkr/src/lib.rs. Multi-schedule selection is unneeded now that #107 is closed, and parallelizing BitMatrix::transpose (~2.1 ms serial) is already tracked directly in #52.

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

    difficulty: hardenhancementgkroptimization-portparallelismschedulingurgency: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions