Skip to content

Optimize for sub-block transform lengths in fft_small transformed rings - #2787

Merged
fredrik-johansson merged 1 commit into
flintlib:mainfrom
fredrik-johansson:fft11
Aug 6, 2026
Merged

Optimize for sub-block transform lengths in fft_small transformed rings#2787
fredrik-johansson merged 1 commit into
flintlib:mainfrom
fredrik-johansson:fft11

Conversation

@fredrik-johansson

Copy link
Copy Markdown
Collaborator

Transformed representations were previously limited to the fft_small block size granularity 256, but can now go down to length 32, 64 or 128.

As a result the input length crossover where FFT wins in nmod_poly_mat_mul roughly halves to ~32 and the cutoff is adjusted accordingly.

For fmpz_mat_mul_fft_small, the crossovers drop ~1000 bits, but I left the existing algorithm cutoffs for now since the effect isn't huge.

Done using Claude Fable 5.

I also tried to smoothen out the jumps at small sizes by adding transforms of length $3 \cdot 2^k$. This does speed up lengths 33-48 for nmod_poly_mat_mul by 5-20% but gives inconsistent speedups at lengths 65-96 or 129-192 with a ~10% slowdown for large matrix dimensions. Omitted from this PR to keep things simple, but may be worth resurrecting with better optimized transform kernels; see the attached patch

0003-composed-lengths.patch

@fredrik-johansson
fredrik-johansson merged commit 13abfe1 into flintlib:main Aug 6, 2026
20 of 21 checks passed
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