Skip to content

build: keep the actual clang-<major> when trimming LLVM (clang-23 was deleted)#17

Open
liminfei-amd wants to merge 1 commit into
lemonade-sdk:mainfrom
liminfei-amd:amd-rocm/trim-keep-clang-major
Open

build: keep the actual clang-<major> when trimming LLVM (clang-23 was deleted)#17
liminfei-amd wants to merge 1 commit into
lemonade-sdk:mainfrom
liminfei-amd:amd-rocm/trim-keep-clang-major

Conversation

@liminfei-amd

@liminfei-amd liminfei-amd commented Jun 15, 2026

Copy link
Copy Markdown

Fixes #16.

What

The "Trim LLVM toolchain" step kept only clang and a hardcoded clang-22, but the bundled LLVM is major 23. The clang driver re-execs clang-23, which the keep-list didn't match — so clang-23 was deleted. The shipped bundle has the clang driver but no clang-23, and Triton's JIT fails with could not exec .../clang-23.

Change

Derive the LLVM major from the resource dir lib/clang/<major> (fallback clang -dumpversion) and keep clang-${major} + its cuda_wrappers path, instead of hardcoding 22. Stays correct across LLVM bumps.

-        # Keep only clang, clang-22, remove everything else from bin/
-        find "$LLVM/bin" -type f ! -name "clang" ! -name "clang-22" -delete
+        CLANG_MAJOR="$(ls "$LLVM/lib/clang" | grep -E '^[0-9]+$' | sort -n | tail -1)"
+        [ -z "$CLANG_MAJOR" ] && CLANG_MAJOR="$("$LLVM/bin/clang" -dumpversion | cut -d. -f1)"
+        find "$LLVM/bin" -type f ! -name "clang" ! -name "clang-${CLANG_MAJOR}" -delete
...
-        rm -rf "$LLVM/lib/clang/22/include/cuda_wrappers"
+        rm -rf "$LLVM/lib/clang/${CLANG_MAJOR}/include/cuda_wrappers"

Evidence

On the released vllm0.22.1-rocm7.13.0-gfx1151 bundle: bin/clang-23 is absent (only the 26 KB clang driver), lib/clang/23/ + libclang-cpp.so.23 are present, and clang --version errors with could not exec .../clang-23. Triton JIT then fails; supplying a system clang lets it compile.

Verification (honest)

I did not re-run the full build CI myself. This repo's pull_request build + the gfx1151 qualification (tier2 inference uses Triton) are the right place to confirm the rebuilt bundle keeps clang-23 and that Triton-based inference passes. Opening as draft for that reason and for maintainer review of the approach.

AI usage disclosure: this change was prepared with AI assistance; a human reviewed and verified it and can explain every line. Verified: missing-binary + JIT failure reproduced on the released bundle.

…d 22)

The LLVM-trim step kept only `clang` and `clang-22`, but the bundled LLVM is
major 23 (lib/clang/23, libclang-cpp.so.23). The `clang` driver re-execs
`clang-23`, which the keep-list did not match, so it was deleted — the shipped
bundle has the `clang` driver but no `clang-23`, and Triton's JIT fails with
"could not exec .../clang-23".

Derive the major from the resource dir `lib/clang/<major>` (fallback to
`clang -dumpversion`) and keep `clang-${major}` plus its cuda_wrappers path,
so this stays correct across LLVM bumps.

Confirmed on the released vllm0.22.1-rocm7.13.0-gfx1151 bundle: clang-23 absent,
JIT fails; supplying a system clang lets it compile. Not re-run through the full
build CI by me — this repo's PR build + gfx1151 qualification can confirm the
rebuilt bundle keeps clang-23 and that Triton-based inference passes. See lemonade-sdk#16.

Signed-off-by: liminfei-amd <91481003+liminfei-amd@users.noreply.github.com>
@liminfei-amd liminfei-amd marked this pull request as ready for review June 15, 2026 02:15
liminfei-amd added a commit to liminfei-amd/vllm-rocm that referenced this pull request Jun 15, 2026
liminfei-amd added a commit to liminfei-amd/vllm-rocm that referenced this pull request Jun 15, 2026
…proven on real AMD bundle: clang-23 survives)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build trims the wrong clang: keep-list hardcodes clang-22 but bundled LLVM is 23 — clang-23 deleted, Triton JIT fails

1 participant