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

Tuning suite #2006

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Tuning suite #2006

wants to merge 4 commits into from

Conversation

albinahlback
Copy link
Collaborator

Remove the n_mod part from #1991, and just focus on the tuning suite.

To keep this concrete, the goal of this PR is to lay the foundation for a somewhat modular tuning suite and to include tuners for

  • n_xgcd and n_gcdinv,
  • flint_mpn_mulhigh_n and flint_mpn_sqrhigh.

Btw, @fredrik-johansson do you know why the current table for k-values for Mulders' high multiplication never favors _flint_mpn_mulhigh_basecase? It feels like it should favor the basecase at least for n < 20.

@fredrik-johansson
Copy link
Collaborator

Btw, @fredrik-johansson do you know why the current table for k-values for Mulders' high multiplication never favors _flint_mpn_mulhigh_basecase? It feels like it should favor the basecase at least for n < 20.

But it does for n = 10, 11, 12 :-)

It's not that surprising to me: for small n Mulders ends up doing three hardcoded multiplications which are extremely fast and for slightly larger n Karatsuba kicks in.

@fredrik-johansson
Copy link
Collaborator

  • Why not implement both n_xgcd_euclidean and n_xgcd_binary so that one can experiment with both without invoking the build system (how we usually do it)?

  • Why not use the existing flint/src/module/tune directories? If the directory structure is to be changed, I think I'd rather use flint/tune than flint/src/tune.

@albinahlback
Copy link
Collaborator Author

  • Why not implement both n_xgcd_euclidean and n_xgcd_binary so that one can experiment with both without invoking the build system (how we usually do it)?

I'm thinking that the binary version is sort of useless if CPU has fast division. I don't really like the idea of having different versions of these sort of functions.

  • Why not use the existing flint/src/module/tune directories? If the directory structure is to be changed, I think I'd rather use flint/tune than flint/src/tune.

I think it is nice if tuning things are gathered nicely together. And I would argue that the tuning is part of the source code, but I'm okay with flint/tune.

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