Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use delayed canonicalization in fmpz_mod_mat_reduce_row #2179

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

fredrik-johansson
Copy link
Collaborator

@fredrik-johansson fredrik-johansson commented Jan 23, 2025

Sample timings for minpoly of an n x n randtest matrix over Z/pZ with a 400-bit p:

n       OLD         NEW
2       1.08e-05    1.06e-05
4       1.67e-05    1.59e-05
8       6.12e-05    4.76e-05
16      0.000403    0.000233
32      0.003       0.00139
64      0.0241      0.0104
128     0.197       0.084
256     1.68        0.799
512     12.573      5.693

One sub-task of #2178.

@fredrik-johansson
Copy link
Collaborator Author

Update: also implemented for mpn_mod.

Timings for mpn_mod matrix minpoly with 400-bit modulus:

n       OLD         NEW
2       3.49e-06    2.43e-06
4       1.11e-05    9.16e-06
8       4.99e-05    4.03e-05
16      0.000301    0.000204
32      0.00215     0.00129
64      0.0163      0.00894
128     0.128       0.0667
256     1.006       0.529
512     8.074       4.1

100-bit modulus:

n       OLD         NEW
2       1.4e-06     1.6e-06
4       6.01e-06    7.12e-06
8       1.03e-05    1.11e-05
16      4.96e-05    4.2e-05
32      0.000457    0.00021
64      0.00356     0.00122
128     0.0281      0.00821
256     0.223       0.0589
512     1.751       0.45

@albinahlback
Copy link
Collaborator

That's a big speedup!

@fredrik-johansson
Copy link
Collaborator Author

I wish I knew why the 32-bit CI is now failing in the tests for gr_poly (presumably just because of the change to gr_ctx_init_random generating different random inputs?). I can't reproduce that error on a different 32-bit system.

@fredrik-johansson
Copy link
Collaborator Author

The segfault is as far as I can tell unrelated to the contents of this PR other than the change in randomization, so I will open a separate issue.

@fredrik-johansson fredrik-johansson merged commit a889164 into flintlib:main Jan 24, 2025
7 of 9 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.

2 participants