Skip to content

Commit ef65b40

Browse files
committed
Modify build script and setup.py for wheel building
1 parent 6515842 commit ef65b40

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

sgl-kernel/build.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ else
1111
fi
1212

1313
docker run --rm \
14-
-v \"$(pwd)\":/sgl-kernel \
14+
-v $(pwd):/sgl-kernel \
1515
pytorch/manylinux-builder:cuda${CUDA_VERSION} \
16-
bash -c \"
16+
bash -c "
1717
${PYTHON_ROOT_PATH}/bin/pip install --no-cache-dir torch==2.5.1 --index-url https://download.pytorch.org/whl/cu${CUDA_VERSION//.} && \
18-
${PYTHON_ROOT_PATH}/bin/pip install --no-cache-dir ninja setuptools>=75.0 wheel numpy && \
18+
${PYTHON_ROOT_PATH}/bin/pip install --no-cache-dir ninja setuptools==75.0.0 wheel==0.41.0 numpy && \
1919
${PYTHON_ROOT_PATH}/bin/python -c 'import setuptools; import sys; print(\"Setuptools path:\", setuptools.__file__); print(\"Python path priority:\", sys.path)' && \
2020
export TORCH_CUDA_ARCH_LIST='7.5 8.0 8.9 9.0+PTX' && \
2121
export CUDA_VERSION=${CUDA_VERSION} && \
@@ -25,5 +25,7 @@ docker run --rm \
2525
mkdir -p /usr/lib/x86_64-linux-gnu/ && \
2626
ln -s /usr/local/cuda-${CUDA_VERSION}/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so && \
2727
cd /sgl-kernel && \
28-
PYTHONPATH=${PYTHON_ROOT_PATH}/lib/python${PYTHON_VERSION}/site-packages ${PYTHON_ROOT_PATH}/bin/python setup.py bdist_wheel
29-
\"
28+
${PYTHON_ROOT_PATH}/bin/python -c 'import setuptools; import importlib.util; print(\"setuptools version:\", setuptools.__version__); import wheel; print(\"wheel version:\", wheel.__version__); print(\"wheel modules:\", dir(wheel))' && \
29+
ls -la ${PYTHON_ROOT_PATH}/lib/python${PYTHON_VERSION}/site-packages/wheel/ && \
30+
PYTHONPATH=${PYTHON_ROOT_PATH}/lib/python${PYTHON_VERSION}/site-packages ${PYTHON_ROOT_PATH}/bin/python -m pip wheel . --no-deps
31+
"

sgl-kernel/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import torch
2222
from setuptools import find_packages, setup
23-
from setuptools.command.bdist_wheel import bdist_wheel
23+
from wheel.bdist_wheel import bdist_wheel
2424
from setuptools.command.build_py import build_py
2525
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
2626

0 commit comments

Comments
 (0)