Skip to content

Commit 64a6965

Browse files
malfetclaude
andauthored
[tools] Update llvm version from 19.1.4 to 21.1.0 (pytorch#8359)
Bumps the custom clang-tidy / clang-format build from LLVM 19.1.4 to 21.1.0, and modernizes the Linux build image so it can still install pytorch's build requirements. ### LLVM version bump (mirrors pytorch#5991, the 17.0.6 -> 19.1.4 change) - `tools/clang-tidy-checks/setup.sh`: clone `llvmorg-21.1.0`, point `apply_patches` at `21.x-patches` - `.github/workflows/clang-tidy-linux.yml`: upload `version: 21.1.0` - `.github/workflows/clang-tidy-macos.yml`: upload `version: 21.1.0` (Intel + M1) As with 19, `apply_patches` stays commented out and no `21.x-patches` directory is added. ### Base image modernization The first rebuild failed on the final Docker layer: Ubuntu 20.04 ships Python 3.8, which can no longer satisfy pytorch's `requirements-build.txt` (`setuptools>=77` dropped 3.8 support, so pip caps at 75.3.4). This is drift in pytorch's requirements, not the LLVM bump — the old image would fail the same way on a rebuild. Rather than bootstrap a newer Python onto EOL Ubuntu 20.04, move to a modern base (matching pytorch's move to CUDA 12): - `Dockerfile.cilint-clang-tidy`: base `nvidia/cuda:11.8.0-devel-ubuntu20.04` -> `nvidia/cuda:12.4.1-devel-ubuntu22.04`, which provides Python 3.10 natively - LLVM apt repo pointed at `jammy` instead of `focal` Ubuntu 22.04 (glibc 2.35) is forward-compatible with manylinux_2_24/_2_28/_2_34 wheels, so all `requirements-build.txt` deps resolve to prebuilt wheels. --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent fd65731 commit 64a6965

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

.github/actionlint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
self-hosted-runner:
22
labels:
33
- ubuntu-24.04 # GitHub hosted runner that actionlint doesn't recognize because actionlint version (1.6.21) is too old
4-
- macos-13
4+
- macos-15-intel
55
- macos-m1-stable
66
- linux.arm64.m8g.4xlarge
77
- linux.12xlarge

.github/workflows/clang-tidy-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
uses: ./.github/actions/clang-tidy-upload
5353
with:
5454
platform: ${{ matrix.platform }}
55-
version: 19.1.4
55+
version: 21.1.0
5656
upload-to-s3: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }}
5757

5858
concurrency:

.github/workflows/clang-tidy-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ permissions:
2121

2222
jobs:
2323
build-Intel:
24-
runs-on: macos-13
24+
runs-on: macos-15-intel
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -50,7 +50,7 @@ jobs:
5050
uses: ./.github/actions/clang-tidy-upload
5151
with:
5252
platform: macos-i386
53-
version: 19.1.4
53+
version: 21.1.0
5454
upload-to-s3: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
5555

5656
build-M1:
@@ -83,7 +83,7 @@ jobs:
8383
uses: ./.github/actions/clang-tidy-upload
8484
with:
8585
platform: macos-arm64
86-
version: 19.1.4
86+
version: 21.1.0
8787
upload-to-s3: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
8888

8989
concurrency:

tools/clang-tidy-checks/Dockerfile.cilint-clang-tidy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# ubuntu20.04-cuda11.8-py3.8-tidy11
2-
FROM nvidia/cuda:11.8.0-devel-ubuntu20.04
1+
# ubuntu22.04-cuda12.4-py3.10-tidy21
2+
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
33

44
ENV DEBIAN_FRONTEND=noninteractive
55

@@ -10,14 +10,14 @@ COPY . clang-tidy-checks
1010
RUN apt-get update && apt-get upgrade -y && apt-get install -y software-properties-common wget
1111
RUN apt-add-repository ppa:git-core/ppa
1212
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
13-
RUN apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main"
13+
RUN apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
1414
RUN apt-get update && \
1515
apt-get install -y --no-install-recommends \
1616
git python3-dev python3-pip python3-setuptools python3-wheel build-essential time \
1717
clang-17 lld ninja-build libomp-17-dev
1818
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 1000
1919
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 1000
20-
run pip3 install cmake==3.22.6
20+
RUN pip3 install cmake==3.22.6
2121

2222
# Run setup script (See ./clang-tidy-checks/README.md for more details)
2323
# Build clang-tidy, copy out the binary, and remove the llvm checkout

tools/clang-tidy-checks/setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ function clone_llvm() {
4848
if [[ -d llvm-project ]]; then
4949
rm -rf llvm-project
5050
fi
51-
git clone -b llvmorg-19.1.4 https://github.com/llvm/llvm-project.git --depth=1
51+
git clone -b llvmorg-21.1.0 https://github.com/llvm/llvm-project.git --depth=1
5252
success
5353
}
5454

5555
function apply_patches() {
5656
info "applying patches"
5757
pushd llvm-project
58-
for check in ../19.x-patches/*.diff; do
58+
for check in ../21.x-patches/*.diff; do
5959
patch -p1 -N -d . < "$check"
6060
done
6161
popd
@@ -109,7 +109,7 @@ function build() {
109109

110110
function setup() {
111111
clone_llvm
112-
# No need to patch llvm-19
112+
# No need to patch llvm-21
113113
# apply_patches
114114
build
115115
}

0 commit comments

Comments
 (0)