Skip to content

coefficient combination optimization - #180

Merged
odraccir1 merged 3 commits into
masterfrom
ra/coefficient_combination_optimization
Oct 21, 2026
Merged

odraccir1 merged 3 commits into
masterfrom
ra/coefficient_combination_optimization

Conversation

@odraccir1

@odraccir1 odraccir1 commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Speed up repeated BN254 coefficient combination by replacing the 54-form prepared representation with a 23-point evaluation scheme.

The new kernel evaluates operands at 0, ±1, …, ±11 and combines interpolation, polynomial reduction, and tower conversion into a fixed 12 × 23 map. Intermediate results remain in radix-52 Montgomery form; only the final 12 coordinates are converted back. This reduces both dot-product work and prepared-cache storage.

The optimization supports IFMA4 and IFMA8, preserves the existing residue bounds, and retains scalar fallback for unsupported configurations.

Measured on an AMD EPYC 9454 with GCC 15.2, using IFMA8, degree 14,938, and four blocks of 123 terms:

Measurement: Original implementation, Optimized
Median coefficient-combination time: 963.39 ms, 398.02 ms
Prepared-cache payload: 3.94 GB, 1.68 GB
Peak process memory: 5.32 GB, 3.06 GB
Composition-cache construction: 61.42 s, 86.49 s

This gives a 2.42× warm-kernel speedup and 57.4% less prepared-cache storage. The comparison uses a historical baseline with matching inputs and settings; kernel timings exclude preparation and verification. Cache construction becomes slower, so the benefit depends on reusing the prepared context. These measurements do not establish an end-to-end prover speedup.

@odraccir1
odraccir1 requested a review from spaceships October 21, 2026 22:29
@odraccir1
odraccir1 merged commit 282d380 into master Oct 21, 2026
2 checks passed
@odraccir1
odraccir1 deleted the ra/coefficient_combination_optimization branch October 21, 2026 22:29
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.

1 participant