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

x/sys/cpu: add support for detecting AVX-512 #41288

Closed
clausecker opened this issue Sep 9, 2020 · 16 comments
Closed

x/sys/cpu: add support for detecting AVX-512 #41288

clausecker opened this issue Sep 9, 2020 · 16 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@clausecker
Copy link

I would like to detect the availability of AVX-512 and its subsets (F, CD, VL, BW, DQ, IFMA, VBMI, ...) using the golang.org/x/sys/cpu package. However, no such flags are available. Please add a way to detect the availability of AVX-512 and its specific sub features. If desired, I can try writing a patch for this myself.

@gopherbot gopherbot added this to the Unreleased milestone Sep 9, 2020
@randall77
Copy link
Contributor

A patch would be great, thanks.

@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 10, 2020
@anton-kuklin
Copy link
Contributor

@fuzxxl Hi, if you will change your mind about doing it by yourself - plz ping me, I will handle this.

@clausecker
Copy link
Author

@justplesh If you would like to do this I would be very happy. Gives me more time to spend writing my paper.

@anton-kuklin
Copy link
Contributor

@clausecker ok, so I'll work on this

@clausecker
Copy link
Author

@justplesh Any progress on this one?

@anton-kuklin
Copy link
Contributor

@clausecker will start in a few days

@clausecker
Copy link
Author

clausecker commented Sep 24, 2020

@justplesh If it's in more than week, I think I'll just do it myself. I have been holding up writing AVX-512 code for two weeks now and would like to begin soon-ish.

@anton-kuklin
Copy link
Contributor

@clausecker I'll try this weekend

@ALTree ALTree changed the title x/sys/cpu: add support for detecting AVX-512. x/sys/cpu: add support for detecting AVX-512 Sep 24, 2020
@gopherbot
Copy link

Change https://golang.org/cl/257937 mentions this issue: cpu: add support for detecting AVX-512

@anton-kuklin
Copy link
Contributor

anton-kuklin commented Sep 27, 2020

@clausecker so, I've implemented the patch, hopefully, it will be merged soon

@martisch
Copy link
Contributor

martisch commented Sep 28, 2020

Note that osxsave needs to be checked and zmm register support (similar to avx and ymm registers) before allowing use of AVX-512.

@anton-kuklin
Copy link
Contributor

anton-kuklin commented Sep 28, 2020

Note that osxsave needs to be checked and zmm register support (similar to avx and ymm registers) before allowing use of AVX-512.

If I understood correctly, we can just check if AVX is supported. As it is already checked :)

@martisch
Copy link
Contributor

martisch commented Sep 28, 2020

The current code does not check xgetbv for zmm and opmask support which i think is needed for safe use. The avx code only checks xmm and ymm support in the os which is not sufficient to make sure the os correctly handles zmm state save and restore.

@anton-kuklin
Copy link
Contributor

The current code does not check xgetbv for zmm and opmask support which i think is needed for safe use. The avx code only checks xmm and ymm support in the os which is not sufficient to make sure the os correctly handles zmm state save and restore.

Yep, you are right. Will handle it.

@clausecker
Copy link
Author

Thank you for the patch! This'll be very useful.

@anton-kuklin
Copy link
Contributor

No problem :) Will be happy to work on the next issues!

@golang golang locked and limited conversation to collaborators Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants