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

Julia's target parsing/detecting deserves a refactor #54482

Open
gbaraldi opened this issue May 15, 2024 · 1 comment
Open

Julia's target parsing/detecting deserves a refactor #54482

gbaraldi opened this issue May 15, 2024 · 1 comment
Labels
compiler:llvm For issues that relate to LLVM pkgimage

Comments

@gbaraldi
Copy link
Member

Julia currently handrolls it's target detection with a very convoluted script that deserves a refactor.

  • We should start using LLVMs TargetParser lib, we already statically link julia to it for some specific uses, and it reduces the burden on us to keep it up to date with new CPUs. (Though it does mean we need to keep up with LLVM to get new cpus being detected). I also am not sure what happens if it doesn't find a CPU and if could we do some fallback logic.
  • Any time this errors we get very weird and obscure errors.
    i.e, if you have a locally built julia with march=native (the default) and try to build a pkgimg for a generic target you get.
Info Given Example was explicitly requested, output will be shown live
ERROR: Unable to find compatible target in cached code image.
Target 0 (sapphirerapids): Rejecting this target due to use of runtime-disabled features

  ✗ Example
  0 dependencies successfully precompiled in 0 seconds

This has probably not been seen before because package images were always just targeting whatever was loaded in the JIT.

  • The code is currently duplicated between aarch64/arm(which we don't even support anymore)/i686/x86_64, which means finding and fixing bugs is way harder than it should be.
@giordano giordano added compiler:llvm For issues that relate to LLVM pkgimage labels May 16, 2024
@gbaraldi
Copy link
Member Author

We should also separate the JIT target from the image target and try to make it less order independent. (Not using the first target as the JIT one will help quite a bit). Though we should do that with having in mind that cross compilation might be a thing in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:llvm For issues that relate to LLVM pkgimage
Projects
None yet
Development

No branches or pull requests

2 participants