Optimize for sub-block transform lengths in fft_small transformed rings - #2787
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.
Transformed representations were previously limited to the
fft_smallblock 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_mulroughly 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_mulby 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 patch0003-composed-lengths.patch