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

Query AVX2 and AVX512VL support when selecting x86 kernels #1949

Merged
merged 7 commits into from
Jan 8, 2019
Merged

Query AVX2 and AVX512VL support when selecting x86 kernels #1949

merged 7 commits into from
Jan 8, 2019

Conversation

martin-frbg
Copy link
Collaborator

For #1947 (and corresponding earlier cases involving Haswell) where VM or OS limitations made otherwise standard features of the correctly detected CPU model unavailable.

@yuyichao
Copy link
Contributor

yuyichao commented Jan 5, 2019

I believe the test here are testing hardware support. (from CPUID).

OS support bit are in XCR0, same as AVX. See the bit assignment in https://en.wikipedia.org/wiki/Control_register#XCR0. In julia (and I believe LLVM) we conservatively check all bits from 5 to 7 (i.e. 0xe0). You can reduce that if you don't need all features I assume....

@martin-frbg
Copy link
Collaborator Author

Indeed, thanks. Hope I got it right now, as I do not have any AVX512 hardware to test this on.

@yuyichao
Copy link
Contributor

yuyichao commented Jan 5, 2019

Didn't check all the bits but it looks right to me as well....

@brianborchers
Copy link

Indeed, thanks. Hope I got it right now, as I do not have any AVX512 hardware to test this on.

I do have a Xeon Skylake system with AVX512 running Linux that I could test on. However, it's not clear that I could provide a complete test, since the main problem here is with OS's that disallow the use of AVX512 instructions on hardware that is otherwise capable.

On my machine, the DYNAMIC_ARCH build should figure out that it has AVX512 and use those kernels. How could I test that this is working correctly?

@mk
Copy link

mk commented Jan 5, 2019

@brianborchers the original issue occurred for me using docker which seems to disable avx512.

I can test this when I’m back at my iMac next week.

@martin-frbg
Copy link
Collaborator Author

If it does not detect a specific capability, the DYNAMIC_ARCH build is supposed to issue a warning about falling back to a less capable cpu. Unfortunately i seem to have missed this in the SkylakeX case, although I preprared the message. Will update this PR in a minute.
Similarly a quick build test should show that the modified getarch writes both HAVE_AVX2=1 and HAVE_AVX512VL=1 to Makefile.conf.

@martin-frbg
Copy link
Collaborator Author

Travis CI seems to be timing out while still installing dependencies on OSX...

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.

4 participants