cleanup + Libc for gpu - #161565
Conversation
|
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.
|
|
|
|
@bors try jobs=dist-x86_64-linux |
This comment has been minimized.
This comment has been minimized.
cleanup + Libc for gpu try-job: dist-x86_64-linux
Originally introduced in the Enzyme build and coppied around since, but without effect for a few years by now.
|
💔 Test for 8052db3 failed: CI. Failed job:
|
|
The job Click to see the possible cause of the failure (guessed by this bot) |
cc @jhuber6 @Kobzol It seems like libc is using yaml for code generation. How acceptable is it to add that dependency? Once a build works, I'll measure the build times, but I'd expect libc-for-gpu to compile very quickly compared to the other components. |
Yeah, it's used to generate the headers from config files instead of tons of |
Disclaimer: I used an llm to implement the fixes, since I still don't like cmake.
I confirm that on a high-level these are the right fixes as far as I can tell, and I reviewed/refactored it.
After #161431 I rebuilt on another server, and got
ld.lld: error: Invalid summary version 14. Version should be in the range [1-12]., since my lld was still on 22, but our submodule now is 23. The issue only shows up when we build the twolibomptarget-nvptxandlibomptarget-amdgpubitcode files (or their libompdevice versions), which we have never been using, and results from https://arxiv.org/abs/2608.13759 also show that we don't need them for now. They are meant to be called from within GPU kernels, so their build was always a bit mroe complicated. The first commit gets rid of them.In theory, we could now even get rid of our clang requirements, but that'd be too easy. So I instead used the second commit to add a new libc-for-gpu component, which allows running (most of?) the standard library on the GPU. Similar to the just removed libompdevice it's meant to be called from kernels, but this time not for optimized algorithms, but for libc functionality. I've tried that previously after our last update to LLVM 22 in #152011, but back then I never got it to work, only to build. This time I also managed to print hello-world from a GPU, so I'm more comfortable merging it. We are not wiring it up yet, and we're also not distributing libc-for-gpu yet, I leave those for a follow-up pr.
closes: #152011
cc @sgasho @Sa4dUs
r? kobzol