Proposal to start bundling LLVM in the rocm-llvm package
tl;dr
I'm proposing that the rocm-llvm package be changed from building on top of system llvm to bundling the full amdclang (the ROCm llvm-project fork [1] ). This email is meant to start a discussion around whether this change would work well for Debian.
[1] https://github.com/ROCm/llvm-project
----------
I introduced myself a while back but I don't really expect folks to have read or remember that email :) I am employed by AMD as part of the team that is packaging ROCm for Linux distros which is relevant to the discussion that I’m trying to start.
Updating ROCm past 6.1 will require an update to the compiler that is used to build the ROCm packages. I'd like to propose that instead of continuing the existing rocm-llvm package which relies on system LLVM, we start bundling the full LLVM fork in the rocm-llvm package. I realize that this isn't the way that the existing Debian packages work so this is very much a proposal and trigger for discussion to see if this change is acceptable.
The current rocm-llvm package [2] builds on top of the system LLVM packages with just the bits where amdclang differs from upstream LLVM. This is similar to the way that Fedora used to package amdclang but that package was changed to bundle the required bits of LLVM for several reasons:
1. There was a mismatch in pace between system LLVM updates and amdclang updates leading to multiple cases of ROCm and amdclang being broken when a version of Fedora was released.
2. amdclang has some history of making api breaking changes which makes more work for whoever is doing the integration with system LLVM.
3. amdclang is mostly tested with the bundled LLVM and may contain ROCm specific bugfixes which have not yet been accepted upstream.
4. There can be feature lag between amdclang and upstream LLVM. Using the amdclang fork can help enable the latest ROCm features.
5. There are features in amdclang that are not yet fully in upstream LLVM (e.g. OpenMP)
[2] https://salsa.debian.org/rocm-team/rocm-llvm
Debian hasn't had the same problems with LLVM update pace that we had in Fedora but the other points remain relevant. While there is work that has to be done either way, there are benefits that come from bundling the amdclang LLVM instead of relying on system LLVM.
Changing the Debian rocm-llvm package to bundle amdclang would leverage the work that my team is already doing for Fedora [3] and SUSE [4] packages which have been bundling LLVM for the last 9 months or so.
[3] https://src.fedoraproject.org/rpms/rocm-compilersupport
[4] https://src.opensuse.org/ROCm/rocm-compilersupport
I have published an early draft of the rocm-llvm package that bundles most of the amdclang LLVM fork [5] (in the experimental-llvmfork-package branch, not master) to help illustrate what I’m talking about. It's still a bit rough but I hope that it can be a good starting point for discussion around this proposal. There is a readme file [6] that lists things I know still need to be fixed/changed in the draft package.
[5] https://salsa.debian.org/tflink/rocm-llvm/-/tree/experimental-llvmfork-package?ref_type=heads
[6] https://salsa.debian.org/tflink/rocm-llvm/-/blob/experimental-llvmfork-package/debian/README.txt?ref_type=heads
It's no secret that my team is working on ROCm packages for Ubuntu and for the sake of transparency, that effort is not unrelated to this proposal - we anticipate packaging a bundled amdclang for Ubuntu. However, that doesn't mean that we see this proposal as the only way forward. My team's intent is to work with the Debian community to do both the Debian packages and the future Ubuntu packages.
One last thing - to make sure that I'm being clear, this proposal isn't just a one-and-done change that's thrown over the wall. My team and I would be participating in the longer-term maintenance beyond this initial change.
If you’ve made it this far, thank you for reading all of that. I’d appreciate any feedback that you have.
Tim
Reply to: