Repository navigation
coefficient combination optimization - #180
Merged
Merged
Conversation
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.
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.