Files
sglang/sgl-kernel/build.sh

17 lines
573 B
Bash
Raw Normal View History

2024-12-02 02:03:49 +08:00
#!/bin/bash
set -ex
PYTHON_VERSION=$1
CUDA_VERSION=$2
PYTHON_ROOT_PATH=/opt/python/cp${PYTHON_VERSION//.}-cp${PYTHON_VERSION//.}
2024-12-02 02:03:49 +08:00
docker run --rm \
2024-12-02 02:03:49 +08:00
-v "$(pwd)":/sgl-kernel \
pytorch/manylinux-builder:cuda${CUDA_VERSION} \
2024-12-02 02:03:49 +08:00
bash -c "
${PYTHON_ROOT_PATH}/bin/pip install --no-cache-dir torch==2.4.0 --index-url https://download.pytorch.org/whl/cu${CUDA_VERSION//.} && \
2024-12-02 02:03:49 +08:00
export TORCH_CUDA_ARCH_LIST='7.5 8.0 8.9 9.0+PTX' && \
export CUDA_VERSION=${CUDA_VERSION} && \
2024-12-02 02:03:49 +08:00
cd /sgl-kernel && \
${PYTHON_ROOT_PATH}/bin/python setup.py bdist_wheel
2024-12-02 02:03:49 +08:00
"