LLVM Minimal Version Requirement

LLVM is our core part, when we use LLVM API, we need to consider different LLVM version. However, we don’t list the minimal version of LLVM requirement. I suggest we proposal one requirement of LLVM version like we do in Python (require Python 3.5+) and add this check in CMakeLists.txt / doc.

I raise this is because I use one api in the STLExtras, but it is introduced in the llvm 4.0 (git history), so if we use llvm-3.8, we can not compile. Luckily I have 3.8 in my machine so I find this problem, but I don’t know which minimal version I should keep during development, because we don’t have any doc / CMakeLists.txt to require.

cc @zhiics @yzhliu @junrushao @tqchen

I remembered TVM crashes with certain versions of LLVM (maybe 7.0.0), so probably minimal version is great but not enough…Shall we also maintain a whitelist of “tested official LLVM distribution”?

Another approach, like what PyTorch did, is to have an Anaconda channel inside which the tested LLVM versions are inside. By tweaking the rpath, we could distribute TVM through conda (and with correct dependency of LLVM).

I think you mean this: Compile Error when running tvm on ubuntu 18.04 4.15 kernel This is ABI compatibility issue as I post. In my opinion, this is not happened often.

Whitelist is a good approach, which could list in our README.md I think. Minimal requirement could list in the README.md too and add check in the CMakeLists.txt.

conda is good, but I think it is for end users. For developers, we want to modify code, it is not very suitable, I think.

I remember we specifically mentioned that LLVM 4.0 or higher version is needed for installation in the installation tutorial. So checking it in during cmake makes sense to me.

1 Like

I’m not sure if whitelisting is the right thing to do. A whitelisted version of LLVM can have a bug that hasn’t yet been discovered, once it is discovered should that LLVM version be removed from the list?

Older versions of LLVM are generally not maintained: a new release supersedes the previous ones, and bugfix releases are based on the latest main release. With the latest LLVM release being 9.0.x, a bug in 7.x.y is not likely to be fixed and released in 7.x.y+1.

Ideally, the minimum LLVM version would be “the oldest LLVM release that is still supported by the LLVM community”, and that means the latest main release, i.e. 9.0.x at the moment.

I agree with this @kparzysz - finding the oldest version that works reliably for all the targets that we care about is going to be painful. It makes sense to me that we can look to get the latest and greatest version and keep that as standard. Any thing before that is really not something we would be able to mandate upstream.

Ramana