Skip to content

Commit 2076f72

Browse files
authored
redo ci: cross python wheel (#824)
apply #662 again, since we have #823 merged now. --------- Signed-off-by: youkaichao <[email protected]>
1 parent fdda958 commit 2076f72

File tree

3 files changed

+7
-31
lines changed

3 files changed

+7
-31
lines changed

.github/workflows/release_wheel.yml

+2-28
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
2928
cuda: ["11.8", "12.1", "12.4"]
3029
torch: ["2.3", "2.4", "2.5"]
3130
exclude: # for cuda 12.4, we only support torch 2.4+
@@ -49,7 +48,6 @@ jobs:
4948
-v "$CI_RUNNER_CACHE_DIR":/ci-cache \
5049
-v "$GITHUB_WORKSPACE":/app \
5150
-e FLASHINFER_CI_CACHE=/ci-cache \
52-
-e FLASHINFER_CI_PYTHON_VERSION=${{ matrix.python }} \
5351
-e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \
5452
-e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \
5553
-e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \
@@ -62,7 +60,7 @@ jobs:
6260

6361
- uses: actions/upload-artifact@v4
6462
with:
65-
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }}
63+
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}
6664
path: dist/*
6765

6866
release:
@@ -81,31 +79,7 @@ jobs:
8179
with:
8280
tag_name: ${{ inputs.tag_name }}
8381
files: |
84-
dist/flashinfer*cp38*.whl
85-
86-
- uses: softprops/action-gh-release@v1
87-
with:
88-
tag_name: ${{ inputs.tag_name }}
89-
files: |
90-
dist/flashinfer*cp39*.whl
91-
92-
- uses: softprops/action-gh-release@v1
93-
with:
94-
tag_name: ${{ inputs.tag_name }}
95-
files: |
96-
dist/flashinfer*cp310*.whl
97-
98-
- uses: softprops/action-gh-release@v1
99-
with:
100-
tag_name: ${{ inputs.tag_name }}
101-
files: |
102-
dist/flashinfer*cp311*.whl
103-
104-
- uses: softprops/action-gh-release@v1
105-
with:
106-
tag_name: ${{ inputs.tag_name }}
107-
files: |
108-
dist/flashinfer*cp312*.whl
82+
dist/flashinfer*.whl
10983
11084
- uses: softprops/action-gh-release@v1
11185
with:

scripts/run-ci-build-wheel.sh

-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ assert_env() {
1111
}
1212

1313
assert_env FLASHINFER_CI_CACHE
14-
assert_env FLASHINFER_CI_PYTHON_VERSION
1514
assert_env FLASHINFER_CI_CUDA_VERSION
1615
assert_env FLASHINFER_CI_TORCH_VERSION
1716
assert_env TORCH_CUDA_ARCH_LIST
@@ -26,8 +25,6 @@ CUDA_MAJOR="${FLASHINFER_CI_CUDA_VERSION%.*}"
2625
CUDA_MINOR="${FLASHINFER_CI_CUDA_VERSION#*.}"
2726
TORCH_MAJOR="${FLASHINFER_CI_TORCH_VERSION%.*}"
2827
TORCH_MINOR="${FLASHINFER_CI_TORCH_VERSION#*.}"
29-
PYVER="${FLASHINFER_CI_PYTHON_VERSION//./}"
30-
export PATH="/opt/python/cp${PYVER}-cp${PYVER}/bin:$PATH"
3128

3229
FLASHINFER_LOCAL_VERSION="cu${CUDA_MAJOR}${CUDA_MINOR}torch${FLASHINFER_CI_TORCH_VERSION}"
3330
if [ -n "${FLASHINFER_GIT_SHA}" ]; then

setup.py

+5
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def __init__(self, *args, **kwargs) -> None:
212212
cxx_flags = [
213213
"-O3",
214214
"-Wno-switch-bool",
215+
"-DPy_LIMITED_API=0x03080000",
215216
]
216217
nvcc_flags = [
217218
"-O3",
@@ -220,6 +221,7 @@ def __init__(self, *args, **kwargs) -> None:
220221
"-Xfatbin",
221222
"-compress-all",
222223
"-use_fast_math",
224+
"-DPy_LIMITED_API=0x03080000",
223225
]
224226
libraries = [
225227
"cublas",
@@ -264,6 +266,7 @@ def __init__(self, *args, **kwargs) -> None:
264266
"cxx": cxx_flags,
265267
"nvcc": nvcc_flags,
266268
},
269+
py_limited_api=True,
267270
)
268271
]
269272
if enable_sm90:
@@ -277,6 +280,7 @@ def __init__(self, *args, **kwargs) -> None:
277280
"cxx": cxx_flags,
278281
"nvcc": nvcc_flags + sm90a_flags,
279282
},
283+
py_limited_api=True,
280284
),
281285
]
282286

@@ -285,4 +289,5 @@ def __init__(self, *args, **kwargs) -> None:
285289
ext_modules=ext_modules,
286290
cmdclass=cmdclass,
287291
install_requires=install_requires,
292+
options={"bdist_wheel": {"py_limited_api": "cp38"}},
288293
)

0 commit comments

Comments
 (0)