Skip to content

Reductionless block multipliers#116

Merged
xrvdg merged 7 commits into
mainfrom
xr/remove-reducer
Jun 2, 2025
Merged

Reductionless block multipliers#116
xrvdg merged 7 commits into
mainfrom
xr/remove-reducer

Conversation

@xrvdg
Copy link
Copy Markdown
Collaborator

@xrvdg xrvdg commented May 30, 2025

This PR removes the reduction step from the scalar and SIMD codegenerators. This gives the caller freedom to choose what kind of reduction strategy to employ.

Additionally, this adds code generators for a 2-round (log jump) Montgomery multiplier and squarer. Without the reducer, the output of the single-step squarer is too high to be used in the square operation of Skyscraper.

stacked on top of #108
closes #120

@xrvdg xrvdg marked this pull request as draft May 30, 2025 06:38
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 30, 2025

CodSpeed Walltime Performance Report

Merging #116 will degrade performances by 59.99%

Comparing xr/remove-reducer (50ecf99) with main (9a9656a)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

⚡ 8 improvements
❌ 6 regressions
✅ 16 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
ark_ff 6.3 µs 4 µs +58.05%
block_mul 4.1 µs 5.1 µs -20.54%
montgomery_interleaved_3 3.8 µs 4.6 µs -18.12%
montgomery_interleaved_4 6.3 µs 3.9 µs +60.57%
scalar_mul 6.1 µs 3.9 µs +57.53%
simd_mul 7.1 µs 4.5 µs +58.2%
ark_ff 5.2 µs 6.6 µs -20.96%
block_sqr 5.8 µs 3.7 µs +56.92%
scalar_sqr 5 µs 6.3 µs -21.1%
simd_sqr 5.4 µs 6.8 µs -20.88%
wrm_overhead 1.7 µs 4.4 µs -59.99%
block3 190.2 µs 164.8 µs +15.43%
block4 233.1 µs 198.2 µs +17.63%
bits_20_fixed 183.9 ms 156.6 ms +17.41%

@xrvdg xrvdg marked this pull request as ready for review May 30, 2025 11:12
@xrvdg xrvdg requested a review from recmo May 30, 2025 11:12
@xrvdg xrvdg changed the base branch from xr/squaring to main May 30, 2025 11:22
@xrvdg xrvdg changed the base branch from main to xr/squaring May 30, 2025 11:25
@xrvdg
Copy link
Copy Markdown
Collaborator Author

xrvdg commented May 30, 2025

Needs to be rebased on main since #108 has been merged.

@xrvdg xrvdg force-pushed the xr/remove-reducer branch from 50ecf99 to da4e2df Compare June 2, 2025 02:46
@xrvdg xrvdg changed the base branch from xr/squaring to main June 2, 2025 02:47
@xrvdg xrvdg merged commit aaf783e into main Jun 2, 2025
2 of 3 checks passed
dcbuild3r pushed a commit that referenced this pull request May 16, 2026
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.

block-multiplier-codegen/src/scalar: xrvdg): take out this reducer. Let the caller reduce.

2 participants