Skip to content

Add an opt-in first-party CUDA proving backend - #75

Open
arthurpaulino wants to merge 1 commit into
mainfrom
ap/gpu
Open

Add an opt-in first-party CUDA proving backend#75
arthurpaulino wants to merge 1 commit into
mainfrom
ap/gpu

Conversation

@arthurpaulino

@arthurpaulino arthurpaulino commented Aug 27, 2026

Copy link
Copy Markdown
Member

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.

Comment thread .github/workflows/ci.yml Fixed
@arthurpaulino
arthurpaulino force-pushed the ap/gpu branch 5 times, most recently from a4f281c to 872a709 Compare August 27, 2026 15:57
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.
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.

2 participants