Skip to content

perf(gpu): more efficient column evaluation claims at the end of GKR - #2754

Merged
tamirhemo merged 12 commits into
mainfrom
erabinov/gkr_evaluations
May 13, 2026
Merged

perf(gpu): more efficient column evaluation claims at the end of GKR#2754
tamirhemo merged 12 commits into
mainfrom
erabinov/gkr_evaluations

Conversation

@erabinov

Copy link
Copy Markdown
Contributor

Before, the CUDA prover used repeated calls to the "jagged fix last variable" function/kernel to produce its evaluation claims on the columns needed at the end of GKR. This would take 15-17ms per shard.

In this PR, we use pointer arithmetic and the tensor dot kernels to do the same work. This takes around 3ms per shard now.

erabinov and others added 4 commits April 24, 2026 11:20
Remove unused imports, debug println!s, and the commented-out fallback
verification in evaluate_traces. Drop the hard-coded one-column zero
padding between preprocessed and main and the matching preprocessed_cols
skip in round_batch_evaluations: evaluate_traces now returns a
contiguous [non-zero preprocessed][non-zero main] layout, and the
caller's evals_so_far is already at the boundary after the preprocessed
loop (it advances by num_polys only for non-zero entries, mirroring
what evaluate_traces writes). This works generally — the previous
layout only happened to align when there was exactly one added padding
column and no poly_size==0 preprocessed entries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor
Test Old New Diff
k256_test_recover_high_hash_high_recid 2078134 2154036 3.6524 %
rust_crypto_rsa_test_pkcs_verify_100 29192167 29240911 0.1670 %
bn_test_bn_test_fq_partial_ord 184121 184121 0.0000 %
curve25519_dalek_test_zero_msm 83941 83941 0.0000 %
secp256k1_program_test_recover_rand_lte_100 5509784 5526087 0.2959 %
sha_test_sha2_v0_10_6_expected_digest_lte_100_times 1349387 1348587 -0.0593 %
k256_test_schnorr_verify 5738592 5735943 -0.0462 %
sha_test_sha2_v0_10_8_expected_digest_lte_100_times 1351982 1349471 -0.1857 %
bn_test_bn_test_g1_msm_edge 406190 406190 0.0000 %
bn_test_bn_test_g1_add_100 985610 985624 0.0014 %
curve25519_dalek_ng_test_add_then_multiply 3809521 4880468 28.1124 %
bls12_381_tests_test_bls_double_100 6346516 6346516 0.0000 %
bn_test_bn_test_fr_inverse_100 818209 818209 0.0000 %
bn_test_bn_test_g1_add_neg 306844 306844 0.0000 %
k256_test_recover_pubkey_infinity 101786 101786 0.0000 %
curve25519_dalek_test_add_then_multiply 3191026 2886579 -9.5407 %
p256_test_recover_rand_lte_100 15977654 15933991 -0.2733 %
secp256k1_program_test_recover_v0_30_0_rand_lte_100 5509580 5510959 0.0250 %
k256_test_point_ops_edge_cases 33844 33844 0.0000 %
sha_test_sha2_v0_10_9_expected_digest_lte_100_times 1348484 1348287 -0.0146 %
sha_test_sha2_v0_9_9_expected_digest_lte_100_times 1262781 1262502 -0.0221 %
bn_test_bn_test_fq_sqrt_100 799609 799609 0.0000 %
keccack_test_expected_digest_lte_100 1719347 1715245 -0.2386 %
bn_test_bn_test_g1_double_100 726696 726696 0.0000 %
curve25519_dalek_ng_test_decompressed_noncanonical 197730 197730 0.0000 %
bls12_381_tests_test_bls_add_100 10498916 10498916 0.0000 %
secp256k1_program_test_verify_rand_lte_100 17112677 17088529 -0.1411 %
bls12_381_tests_test_inverse_fp2_100 2659337 2659337 0.0000 %
rustcrypto_bigint_test_bigint_mul_add_residue 1736063 1736063 0.0000 %
curve25519_dalek_test_decompressed_expected_value 4637087 4637087 0.0000 %
sha_test_sha3_expected_digest_lte_100_times 1192218 1192319 0.0085 %
p256_test_recover_pubkey_infinity 102133 102133 0.0000 %
p256_test_verify_rand_lte_100 11858815 11860972 0.0182 %
rustcrypto_bigint_test_bigint_mul_mod_special 2084120 2084120 0.0000 %
bn_test_bn_test_g1_mul_zero 45725 45725 0.0000 %
bls12_381_tests_test_sqrt_fp_100 885856 939825 6.0923 %
curve25519_dalek_test_decompressed_noncanonical 7785 7785 0.0000 %
curve25519_dalek_test_zero_mul 72415 72415 0.0000 %
curve25519_dalek_ng_test_zero_msm 125894 125894 0.0000 %
k256_test_verify_rand_lte_100 11913064 11901297 -0.0988 %
secp256k1_program_test_verify_v0_30_0_rand_lte_100 17093019 17119517 0.1550 %
p256_test_recover_high_hash_high_recid 7167826 4787896 -33.2030 %
bn_test_bn_test_fq_inverse_100 801209 801209 0.0000 %
curve25519_dalek_test_ed25519_verify 13325245 13327283 0.0153 %
curve25519_dalek_ng_test_zero_mul 108392 108392 0.0000 %
k256_test_recover_rand_lte_100 4576533 4570807 -0.1251 %
bls12_381_tests_test_sqrt_fp2_100 1664905 1728283 3.8067 %
bls12_381_tests_test_inverse_fp_100 1474453 1474453 0.0000 %

@tamirhemo
tamirhemo enabled auto-merge (squash) May 13, 2026 21:33
@tamirhemo
tamirhemo merged commit 83f4d62 into main May 13, 2026
10 checks passed
@tamirhemo
tamirhemo deleted the erabinov/gkr_evaluations branch May 13, 2026 22:08
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