Add an opt-in first-party CUDA proving backend - #75
Open
arthurpaulino wants to merge 1 commit into
Open
Conversation
arthurpaulino
force-pushed
the
ap/gpu
branch
5 times, most recently
from
August 27, 2026 15:57
a4f281c to
872a709
Compare
Accelerate the Goldilocks/BLAKE3 prover with first-party CUDA while keeping the default CPU build independent of nvcc, the CUDA runtime, and NVIDIA hardware. The GPU path keeps DFT/LDE, mixed-height BLAKE3 commitments, lookup construction, quotient evaluation, batched openings, and binary FRI folding device-resident. Preserve the protocol, proof format, proof sizes, transcript order, and CPU verification behavior. Canonicalize lazy Goldilocks representatives at proof serialization so CPU and CUDA proofs are byte-identical. This intentionally changes newly generated proof bytes relative to c72d321; old proofs remain verifiable, and README.md documents the compatibility boundary. Harden the backend after adversarial review: keep pinned traces alive through CUDA handle destruction, reject unsupported Merkle caps and multi-bit GPU FRI, remove the racy generic FRI fold, canonicalize host uploads with grid-stride coverage, place kernel-visible metadata in managed allocations, derive spill headroom from device memory while reserving later-stage scratch, honor device selection, gate dynamic shared memory on device limits, remove the fixed constant-cache ceiling, validate FFI dimensions including one-row quotient steps, and discover nvcc through CUDA_HOME/CUDA_PATH. Generate quotient-coset selectors directly in device memory from compact geometric parameters, using chunked recurrences and in-place batch inversion. This removes the largest remaining happy-path host-to-device upload without increasing peak VRAM. At Ix Vector.extract_append q50 scale, combined inner/outer quotient time falls from 1.73s to 1.45s. Build native cubins for a supported common architecture set, add CUDA compile CI, a threshold-crossing CPU/GPU byte-compatibility smoke test, honest transfer-inclusive microbenchmarks, Plonky3 provenance, and dated benchmark documentation. Organize the Rust backend under src/cuda. The CUDA configuration currently supports Linux x86_64, cap_height=0, and binary FRI. On an RTX PRO 6000 Blackwell, Ix Vector.extract_append recursive q50 reduces the post-execution-and-trace portion of inner and outer proving from 71.87s on CPU to 8.74s with CUDA (8.22x), with identical proof sizes and successful verification. End-to-end proving also includes Aiur execution and trace construction, which remain outside this comparison. Fifty queries is a development benchmark parameter, not a production security recommendation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Accelerate the Goldilocks/BLAKE3 prover with first-party CUDA while keeping the default CPU build independent of nvcc, the CUDA runtime, and NVIDIA hardware. The GPU path keeps DFT/LDE, mixed-height BLAKE3 commitments, lookup construction, quotient evaluation, batched openings, and binary FRI folding device-resident.
Preserve the protocol, proof format, proof sizes, transcript order, and CPU verification behavior. Canonicalize lazy Goldilocks representatives at proof serialization so CPU and CUDA proofs are byte-identical. This intentionally changes newly generated proof bytes relative to c72d321; old proofs remain verifiable, and README.md documents the compatibility boundary.
Harden the backend after adversarial review: keep pinned traces alive through CUDA handle destruction, reject unsupported Merkle caps and multi-bit GPU FRI, remove the racy generic FRI fold, canonicalize host uploads with grid-stride coverage, place kernel-visible metadata in managed allocations, derive spill headroom from device memory while reserving later-stage scratch, honor device selection, gate dynamic shared memory on device limits, remove the fixed constant-cache ceiling, validate FFI dimensions including one-row quotient steps, and discover nvcc through CUDA_HOME/CUDA_PATH.
Generate quotient-coset selectors directly in device memory from compact geometric parameters, using chunked recurrences and in-place batch inversion. This removes the largest remaining happy-path host-to-device upload without increasing peak VRAM. At Ix Vector.extract_append q50 scale, combined inner/outer quotient time falls from 1.73s to 1.45s.
Build native cubins for a supported common architecture set, add CUDA compile CI, a threshold-crossing CPU/GPU byte-compatibility smoke test, honest transfer-inclusive microbenchmarks, Plonky3 provenance, and dated benchmark documentation. Organize the Rust backend under src/cuda. The CUDA configuration currently supports Linux x86_64, cap_height=0, and binary FRI.
On an RTX PRO 6000 Blackwell, Ix Vector.extract_append recursive q50 reduces the post-execution-and-trace portion of inner and outer proving from 71.87s on CPU to 8.74s with CUDA (8.22x), with identical proof sizes and successful verification. End-to-end proving also includes Aiur execution and trace construction, which remain outside this comparison. Fifty queries is a development benchmark parameter, not a production security recommendation.