-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Archspec support for JULIA_CPU_TARGET
and MARCH
#42073
Comments
@vchuravy feel free to edit this if you think the description could be improved. |
Right now we encode and detect CPU names c.f. (https://github.com/JuliaLang/julia/blob/master/src/processor_x86.cpp and https://github.com/JuliaLang/julia/blob/master/src/features_x86.h) One important note is that in the end we have to translate to whatever LLVM/LLC understands: Lines 41 to 42 in dd8d3c7
On LLVM 12 (Julia 1.7+) we recognize:
|
Related to #29592.
Ping @vchuravy.
This request sprung out of some Spack users attempting to map Spack's targets to
JUILA_CPU_TARGET
andMARCH
Seejulia/package.py
. They were trying too setJULIA_CPU_TARGET
tox86_64_v3
, but Julia didn't know the name.Microarchitecture names are getting more complicated, e.g, the
glibc
developers have introducedx86_64
levels forgcc
andclang
. Mapping these to all the compilers you might build Julia with is tough. Also, knowing where optimized binaries can be used can be complicated.Spack builds binaries for specific microarchitectures, and it knows where those binaries can be used. To do this, it uses the archspec library to detect and reason about CPU targets and microarchitecture flags. Archspec provides some useful features:
cascadelake
,skylake_avx512
,haswell
,x86_64
,x86_64_v3
, etc.)/proc/cpuinfo
and other toolscascadelake
andcanonlake
can runskylake_avx512
binaries but not each others')Most of
archspec
's knowledge is inmicroarchitectures.json
- look at it to get a feel for the type of data we're talking about here. It would be pretty simple to build Julia bindings on top ofmicroarchitectures.json
-- we've separated it out so that other languages can have bindings.So, TL;DR: it would be great if Julia used archspec names. The immediate benefit for Julia would be support for things like the glibc x86_64 levels, and the ability to use a common set of targets across compilers. The longer term benefit would be that things like Yggdrasil could use the compatibility logic to distribute optimized binaries for native (non-Julia) packages and understand their compatibility across machines.
The text was updated successfully, but these errors were encountered: