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

Configure and flint-mparam for meteorlake #2239

Merged
merged 9 commits into from
Feb 6, 2025

Conversation

vneiger
Copy link
Collaborator

@vneiger vneiger commented Feb 4, 2025

This allows Intel's meteorlake CPUs to be identified during configure. This adds corresponding parameters in meteorlake/flint-mparam.h.

@vneiger
Copy link
Collaborator Author

vneiger commented Feb 4, 2025

This made me realise that recent Intel processors (RaptorLake, AlderLake, ... probably all those more recent than IceLake) will not benefit from the enhancement in #2233 , since they still rely on SkyLake's flint-mparam.h. Should we create a flint-mparam for each of them? Or, more simply (but maybe less cleanly), should we make them all rely on IceLake's parameters, since they coincide for all we know at the moment?

Comment on lines +17 to +22
/* TODO these were taken directly from skylake flint-mparam.h ----> */
#define FLINT_FFT_SMALL_MUL_THRESHOLD 1540
#define FLINT_FFT_SMALL_SQR_THRESHOLD 3080

#define FLINT_FFT_MUL_THRESHOLD 32000
#define FLINT_FFT_SQR_THRESHOLD 32000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These would be nice to figure out, but I suppose they are conservative at best. Regardless, we need a proper tuning suite as it is quite tedious to do these by hand.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was not sure how to find them easily (i.e. without looking through the code to find out what they mean, then create some profile/tune file, etc.). Most others were output by a tuning file (FFT_TAB, MULMOD_TAB, etc.).

@vneiger
Copy link
Collaborator Author

vneiger commented Feb 6, 2025

The latest commits added a flint-mparam file for Tiger Lake and Raptor Lake. These commits also make other Intel processors from architectures more recent than SkyLake fall back to IceLake's flint-mparam instead of SkyLake. This way these processors will benefit from the change in #2233 , and also have a more relevant threshold for modular multiplications with precomputations (mulmod_shoup). Both aspects boil down to the efficiency of udiv_qrnnd, and since I didn't have access to these processors I checked on uops.info that they should behave similarly to IceLake.

@vneiger
Copy link
Collaborator Author

vneiger commented Feb 6, 2025

@albinahlback a quick re-check of the recent commits could be useful before merging.

@albinahlback
Copy link
Collaborator

I think it looks good!

@vneiger vneiger merged commit e7aa8f5 into flintlib:main Feb 6, 2025
12 checks passed
@albinahlback
Copy link
Collaborator

Sorry, I was about to squash and merge the commits. I only discussed this with Fredrik, so it is my fault for not bringing this forward to everyone:

Every PR should now be squashed when merging.

This allows us to:

  • Merge all commits into one single commit.
  • The Git log now contains the number of the pull request in its title.
  • Avoid duplicate commit messages by amending the Git log. In this case, two commits have the title fallback to icelake instead of skylake.
  • Amend the Git log to make it more descriptive. To me, add raptorlake and tigerlake is not that descriptive. Of course, I know what it means in this context, but looking back at this in say 1 year, I would probably have to look at the difference to tell what it really meant. Probably something like Add flint-mparam.h for raptorlake and tigerlake would be more suitable.

Now, I took examples from here for convenience, but please do not feel targeted.

@fredrik-johansson @vneiger @edgarcosta

@fredrik-johansson
Copy link
Collaborator

What Albin said, to make the history easier to follow, though I would relax this:

Every PR should now be squashed when merging.

Not every PR necessarily; some PRs do several related things, and it's fine to keep the individual commits in some cases if they make sense independently.

@vneiger
Copy link
Collaborator Author

vneiger commented Feb 6, 2025

Sorry, I was about to squash and merge the commits

Oops, ok. I had seen a comment of this kind in some recent PR or issue, but maybe did not pay close enough attention to it, sorry.

Thanks for explaining the recommended procedure in detail!

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.

3 participants