Skip to content

Commit 0c3543d

Browse files
zhyncsFridge003
andauthored
chore: upgrade flashinfer 0.5.0 (sgl-project#12523)
Co-authored-by: Baizhou Zhang <[email protected]>
1 parent 6a3b9fd commit 0c3543d

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

python/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ dependencies = [
2626
"datasets",
2727
"einops",
2828
"fastapi",
29-
"flashinfer_python==0.4.1",
29+
"flashinfer_python==0.5.0",
30+
"flashinfer_cubin==0.5.0",
31+
"flashinfer_jit_cache==0.5.0",
3032
"gguf",
3133
"hf_transfer",
3234
"huggingface_hub",

python/sglang/check_env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def is_cuda_v2():
2222
"sglang",
2323
"sgl_kernel",
2424
"flashinfer_python",
25+
"flashinfer_cubin",
26+
"flashinfer_jit_cache",
2527
"triton",
2628
"transformers",
2729
"torchao",

python/sglang/srt/entrypoints/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def _set_envs_and_config(server_args: ServerArgs):
712712
if server_args.attention_backend == "flashinfer":
713713
assert_pkg_version(
714714
"flashinfer_python",
715-
"0.4.1",
715+
"0.5.0",
716716
"Please uninstall the old version and "
717717
"reinstall the latest version by following the instructions "
718718
"at https://docs.flashinfer.ai/installation.html.",

python/sglang/srt/utils/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,9 @@ def set_cuda_arch():
23862386
if is_flashinfer_available():
23872387
capability = torch.cuda.get_device_capability()
23882388
arch = f"{capability[0]}.{capability[1]}"
2389-
os.environ["TORCH_CUDA_ARCH_LIST"] = f"{arch}{'+PTX' if arch == '9.0' else ''}"
2389+
os.environ["FLASHINFER_CUDA_ARCH_LIST"] = (
2390+
f"{arch}{'a' if capability[0] >= 9 else ''}"
2391+
)
23902392

23912393

23922394
def next_power_of_2(n: int):

scripts/ci/ci_install_dependency.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ echo "CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-}"
2323
# Clear torch compilation cache
2424
python3 -c 'import os, shutil, tempfile, getpass; cache_dir = os.environ.get("TORCHINDUCTOR_CACHE_DIR") or os.path.join(tempfile.gettempdir(), "torchinductor_" + getpass.getuser()); shutil.rmtree(cache_dir, ignore_errors=True)'
2525
rm -rf /root/.cache/flashinfer
26+
pip3 uninstall flashinfer-python flashinfer-cubin flashinfer-jit-cache || true
2627

2728
# Install apt packages
2829
apt install -y git libnuma-dev libssl-dev pkg-config
@@ -93,7 +94,7 @@ else
9394
fi
9495

9596
# Install the main package
96-
$PIP_CMD install -e "python[dev]" --extra-index-url https://download.pytorch.org/whl/${CU_VERSION} $PIP_INSTALL_SUFFIX
97+
$PIP_CMD install -e "python[dev]" --extra-index-url https://download.pytorch.org/whl/${CU_VERSION} --extra-index-url https://flashinfer.ai/whl/${CU_VERSION} $PIP_INSTALL_SUFFIX
9798

9899
# Install router for pd-disagg test
99100
$PIP_CMD install sglang-router $PIP_INSTALL_SUFFIX

sgl-kernel/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ docker run --rm \
147147
ln -sv /usr/lib64/libibverbs.so.1 /usr/lib64/libibverbs.so && \
148148
${PYTHON_ROOT_PATH}/bin/${TORCH_INSTALL} && \
149149
${PYTHON_ROOT_PATH}/bin/pip install --no-cache-dir ninja setuptools==75.0.0 wheel==0.41.0 numpy uv scikit-build-core && \
150-
export TORCH_CUDA_ARCH_LIST='8.0 8.9 9.0+PTX' && \
150+
export FLASHINFER_CUDA_ARCH_LIST='8.0 8.9 9.0a 10.0a 12.0a' && \
151151
export CUDA_VERSION=${CUDA_VERSION} && \
152152
mkdir -p /usr/lib/${ARCH}-linux-gnu/ && \
153153
ln -s /usr/local/cuda-${CUDA_VERSION}/targets/${LIBCUDA_ARCH}-linux/lib/stubs/libcuda.so /usr/lib/${ARCH}-linux-gnu/libcuda.so && \

0 commit comments

Comments
 (0)