numba / llvmlite

A lightweight LLVM python binding for writing JIT compilers
https://llvmlite.pydata.org/
BSD 2-Clause "Simplified" License
1.94k stars 322 forks source link

Use LLVM 15 by default, add experimental LLVM 16 support #1067

Closed gmarkall closed 4 months ago

gmarkall commented 5 months ago

Changes required to use LLVM 15 by default, and to support LLVM 16 experimentally, include:

CI config:

Docs:

llvmlite itself:

sklam commented 4 months ago

Just noticed that this doesn't bump the llvmdev version in the conda recipe

sklam commented 4 months ago

It should replace the conda-recipes/llvmlite with conda-recipes/llvmlite_llvm15

gmarkall commented 4 months ago

Ah I thought we might just delete the LLVM 14 version separately as I didn't know if it would be a problem for the build farm setup if the recipe names changed.

sklam commented 4 months ago

Before this can be merged, we also need to synchronize Numba to use opaque type

gmarkall commented 4 months ago

@sklam many thanks for the review and pointers!

Just noticed that this doesn't bump the llvmdev version in the conda recipe

I don't think we want to do this. This PR doesn't have anything to do with llvmdev builds - the llvmdev build was merged in #1036.

It should replace the conda-recipes/llvmlite with conda-recipes/llvmlite_llvm15

This is now done (and I've also done the same with the llvmdev recipe, since the llvmdev 14 recipe is no longer needed).

Before this can be merged, we also need to synchronize Numba to use opaque type

I don't think we want to do this. I thought that the plan was:

  1. Bump to LLVM 15
  2. Switch Numba to Opaque Pointers
  3. Bump to LLVM 16+ (once other pre-requisites are solved)

This is because as I understand it, the typed / opaque pointer support in LLVM versions is:

We still unconditionally disable opaque pointers in llvmlite with this PR, so Numba should be unaffected for now, and we are in a position to be able to switch to Opaque Pointers smoothly on an LLVM version (15) that supports both, without having to worry about experimental-related issues (Opaque Pointers on 14) or bitrot (Typed Pointers on 16).

gmarkall commented 4 months ago

Just to add a little to my last comment - I don't think we should be testing Numba with LLVM 16 yet, the CI for LLVM 16 here is only for llvmlite development to ensure future compatibility, with no expectation that Numba works with that configuration yet.

gmarkall commented 4 months ago

xref: llvmlite Opaque Pointer support is in #1064.

sklam commented 4 months ago

CI is good. I've build this PR on the buildfarm llvmlite dag and tested the artifacts manually against numba main.

doko42 commented 4 months ago

there's no way to inject an environment variable to set LLVM_CONFIG from the config file

update PATH before starting your build:

PATH=/usr/lib/llvm-/bin:$PATH llvm-config

gmarkall commented 4 months ago

there's no way to inject an environment variable to set LLVM_CONFIG from the config file

update PATH before starting your build:

PATH=/usr/lib/llvm-/bin:$PATH llvm-config

How do you do that in the context of our RTD configuration?

doko42 commented 4 months ago

sorry, I don't know about RTD configuration

gmarkall commented 4 months ago

sorry, I don't know about RTD configuration

For some background, the problem with RTD configuration is that you can't set environment variables in it as far as I know (from the linked issue in the description of this PR). If I could set an environment variable before starting the build, I'd be able to set LLVM_CONFIG to point to the correct llvm-config binary, and there wouldn't be any need for workarounds like running sed over the build script.