Skip to content

Commit 8af9311

Browse files
authored
[release-only] Add manylinux2014_x86_64 for PyTorch release 2.6 (triton-lang#5414)
Add manylinux2014_x86_64 for PyTorch release 2.6 Add ability to upload build wheels to github
1 parent dbc771e commit 8af9311

File tree

3 files changed

+93
-4
lines changed

3 files changed

+93
-4
lines changed

.github/workflows/wheels.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
workflow_dispatch:
44
schedule:
55
- cron: "0 8 * * *"
6+
pull_request:
7+
paths:
8+
- .github/workflows/wheels_v2.yml
69

710
permissions: read-all
811

@@ -50,23 +53,27 @@ jobs:
5053
- name: Build wheels
5154
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
5255
run: |
56+
python3 -m pip install cibuildwheel --upgrade --user
5357
export LATEST_DATE=$(TZ=UTC0 git show --quiet --date='format-local:%Y%m%d%H%M%S' --format="%cd")
5458
# Pass MAX_JOBS=4 because, at time of writing, the VM "only" has 32GB
5559
# of RAM and OOMs while building if we give it the default number of
5660
# workers (2 * NUM_CPUs).
5761
export CIBW_ENVIRONMENT="MAX_JOBS=4 \
58-
TRITON_WHEEL_NAME=triton-nightly \
59-
TRITON_WHEEL_VERSION_SUFFIX=-$LATEST_DATE \
6062
TRITON_BUILD_WITH_CLANG_LLD=1"
6163
export CIBW_MANYLINUX_X86_64_IMAGE="quay.io/pypa/manylinux_2_28_x86_64:latest"
6264
#export CIBW_MANYLINUX_PYPY_X86_64_IMAGE="quay.io/pypa/manylinux_2_28_x86_64:latest"
6365
# many_linux_2_28 image comes with GCC 12.2.1, but not clang.
6466
# With this install, it gets clang 16.0.6.
6567
export CIBW_BEFORE_ALL="dnf install clang lld -y";
6668
export CIBW_SKIP="cp{35,36,37}-*"
67-
export CIBW_BUILD="cp3*-manylinux_x86_64"
69+
export CIBW_BUILD="cp3{9,10,11,12,13}-manylinux_x86_64"
6870
python3 -m cibuildwheel python --output-dir wheelhouse
6971
72+
- uses: actions/upload-artifact@v4
73+
with:
74+
name: cibw-wheels-manylinux_2_28_x86_64-wheels-upload
75+
path: ./wheelhouse/*.whl
76+
7077
- name: Install Azure CLI
7178
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
7279
run: |

.github/workflows/wheels_v2.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Wheels Build manylinux2014_x86_64
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: "20 2 * * *"
6+
pull_request:
7+
paths:
8+
- .github/workflows/wheels_v2.yml
9+
10+
jobs:
11+
12+
Build-Wheels:
13+
timeout-minutes: 60
14+
15+
runs-on: [self-hosted, CPU]
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
steps:
21+
22+
- name: Prune stale docker containers
23+
run: |
24+
# If cibuildwheel crashes (or, say, is OOM-killed), it leaves behind a
25+
# docker container. Eventually these consume all the disk space on
26+
# this machine.
27+
docker container prune -f
28+
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
# The LATEST_DATE here should be kept in sync with the one in Patch setup.py
33+
- id: check-version
34+
name: Check latest version
35+
run: |
36+
export PACKAGE_DATE=$(python3 -m pip install --user --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/Triton-Nightly/pypi/simple/ --dry-run triton-nightly== |& grep -oP '(?<=, )[0-9\.]+dev[0-9]+(?=\))' | grep -oP '(?<=dev)[0-9]+')
37+
export LATEST_DATE=$(TZ=UTC0 git show --quiet --date='format-local:%Y%m%d%H%M%S' --format="%cd")
38+
if cmp -s <(echo $PACKAGE_DATE) <(echo $LATEST_DATE); then
39+
echo "new_commit=false" >> "$GITHUB_OUTPUT"
40+
else
41+
echo "new_commit=true" >> "$GITHUB_OUTPUT"
42+
fi
43+
44+
- name: Patch setup.py
45+
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
46+
run: |
47+
echo "" >> python/setup.cfg
48+
echo "[build_ext]" >> python/setup.cfg
49+
echo "base-dir=/project" >> python/setup.cfg
50+
51+
- name: Build wheels
52+
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
53+
run: |
54+
python3 -m pip install cibuildwheel --upgrade --user
55+
export LATEST_DATE=$(TZ=UTC0 git show --quiet --date='format-local:%Y%m%d%H%M%S' --format="%cd")
56+
# Pass MAX_JOBS=4 because, at time of writing, the VM "only" has 32GB
57+
# of RAM and OOMs while building if we give it the default number of
58+
# workers (2 * NUM_CPUs).
59+
#
60+
# Sadly, I couldn't make TRITON_BUILD_WITH_CLANG_LLD=1 work. The
61+
# manylinux image has a relatively recent gcc (v10, released 2020),
62+
# but its clang is ancient, v3.4, released in 2014 (!). I tried
63+
# installing the prebuilt clang 10 binary distributed by LLVM, and I
64+
# quickly ran into Linux DLL hell. I give up, for now. Perhaps
65+
# manylinux_x_y will save us; I didn't try.
66+
export CIBW_ENVIRONMENT="MAX_JOBS=4 TRITON_WHEEL_NAME=triton"
67+
export CIBW_MANYLINUX_X86_64_IMAGE="quay.io/pypa/manylinux2014_x86_64:latest"
68+
#export CIBW_MANYLINUX_PYPY_X86_64_IMAGE="quay.io/pypa/manylinux2014_x86_64:latest"
69+
export CIBW_BEFORE_BUILD="pip install cmake;"
70+
export CIBW_SKIP="cp{35,36,37,38}-*"
71+
export CIBW_BUILD="cp3{9,10,11,12,13}-manylinux_x86_64"
72+
python3 -m cibuildwheel python --output-dir wheelhouse
73+
74+
- uses: actions/upload-artifact@v4
75+
with:
76+
name: cibw-wheels-manylinux2014-wheels-upload
77+
path: ./wheelhouse/*.whl
78+
79+
- name: Upload wheels to PyPI
80+
if: false # Disable Upload to PyPI until ready for release
81+
run: |
82+
python3 -m twine upload wheelhouse/* -u __token__ -p ${{ secrets.PYPY_API_TOKEN }}

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,11 +723,11 @@ def get_git_commit_hash(length=8):
723723
"Intended Audience :: Developers",
724724
"Topic :: Software Development :: Build Tools",
725725
"License :: OSI Approved :: MIT License",
726-
"Programming Language :: Python :: 3.8",
727726
"Programming Language :: Python :: 3.9",
728727
"Programming Language :: Python :: 3.10",
729728
"Programming Language :: Python :: 3.11",
730729
"Programming Language :: Python :: 3.12",
730+
"Programming Language :: Python :: 3.13",
731731
],
732732
test_suite="tests",
733733
extras_require={

0 commit comments

Comments
 (0)