Miscellaneous nmod optimizations and helper functions#2636
Miscellaneous nmod optimizations and helper functions#2636fredrik-johansson merged 8 commits intoflintlib:mainfrom
nmod optimizations and helper functions#2636Conversation
|
A minor terminology question, to make things consistent: how to call the "sloppy" suggests that the result may be wrong, which is maybe misleading (although strictly speaking the result is wrong in the sense that it is not totally reduced). I've seen in some places "lazy" being used for this, but mostly in articles or notes specifically about NTT/FFT implementations (see e.g. section 3.3 here ). This is maybe also because such reductions or modular multiplications are used in "lazy approaches" where one tries to accumulate computations before reducing. For example within the draft PR #2107 I encounter a lot of such cases so I chose to use names that indicate how lazy the reduction is (e.g. Any suggestion of a third name for this, or any preference between "sloppy" and "lazy"? |
|
Good question. There is also |
Ok, if we go for lazy, I will spot the few places where I had implicitly used a lazy |
n_mulhiandn_mod_barrett,n_mod_barrett_sloppy,n_mod_lemire(plus their respective precomputation methods as public functions), replacing some previous private reimplementations of these functionsn_divremfunctions in theradixmodule (not yet made public in this PR, as I'm not yet sure about the interface)fft_small(up to 2.5% speedup for polynomial multiplication)nmod_polydivision (affecting polmod operations andfq_nmodarithmetic)make check MOD=fq_nmod_poly(with 10x test multiplier): 5.995 s -> 7.371 s (23% speedup)build/examples/minimal_irreducibles 5 3125 3125: 3.972 s -> 3.256 s (22% speedup)