"_backup/topdown/.gitignore" did not exist on "2455934ac41647d24b743871a6dc531253fa8f63"
ci_install_dependency.sh 2.29 KB
Newer Older
1
#!/bin/bash
2
# Install the dependency in CI.
3
set -euxo pipefail
Lianmin Zheng's avatar
Lianmin Zheng committed
4

5
IS_BLACKWELL=${IS_BLACKWELL:-0}
fzyzcjy's avatar
fzyzcjy committed
6

7
if [ "$IS_BLACKWELL" = "1" ]; then
fzyzcjy's avatar
fzyzcjy committed
8
    CU_VERSION="cu129"
9
10
else
    CU_VERSION="cu126"
fzyzcjy's avatar
fzyzcjy committed
11
12
fi

13
# Kill existing processes
14
15
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
bash "${SCRIPT_DIR}/killall_sglang.sh"
16

17
18
19
20
21
22
23
24
25
# Install apt packages
apt install -y git libnuma-dev

# Install uv
if [ "$IS_BLACKWELL" = "1" ]; then
    # The blackwell CI runner has some issues with pip and uv,
    # so we can only use pip with `--break-system-packages`
    PIP_CMD="pip"
    PIP_INSTALL_SUFFIX="--break-system-packages"
fzyzcjy's avatar
fzyzcjy committed
26

27
28
29
30
    # Clean up existing installations
    $PIP_CMD uninstall -y flashinfer_python sgl-kernel sglang vllm $PIP_INSTALL_SUFFIX || true
else
    # In normal cases, we use uv, which is much faster than pip.
Cheng Wan's avatar
Cheng Wan committed
31
    pip install --upgrade pip
32
33
    pip install uv
    export UV_SYSTEM_PYTHON=true
34

35
36
37
38
39
40
    PIP_CMD="uv pip"
    PIP_INSTALL_SUFFIX="--index-strategy unsafe-best-match"

    # Clean up existing installations
    $PIP_CMD uninstall flashinfer_python sgl-kernel sglang vllm || true
fi
Xiaoyu Zhang's avatar
Xiaoyu Zhang committed
41
42

# Install the main package
43
$PIP_CMD install -e "python[dev]" --extra-index-url https://download.pytorch.org/whl/${CU_VERSION} $PIP_INSTALL_SUFFIX
Xiaoyu Zhang's avatar
Xiaoyu Zhang committed
44

45
if [ "$IS_BLACKWELL" = "1" ]; then
46
47
    # TODO auto determine sgl-kernel version
    SGL_KERNEL_VERSION=0.3.2
48
    $PIP_CMD install https://github.com/sgl-project/whl/releases/download/v${SGL_KERNEL_VERSION}/sgl_kernel-${SGL_KERNEL_VERSION}-cp39-abi3-manylinux2014_x86_64.whl --force-reinstall $PIP_INSTALL_SUFFIX
49
50
fi

51
# Show current packages
52
$PIP_CMD list
53

Xiaoyu Zhang's avatar
Xiaoyu Zhang committed
54
# Install additional dependencies
55
$PIP_CMD install mooncake-transfer-engine==0.3.5 nvidia-cuda-nvrtc-cu12 py-spy huggingface_hub[hf_xet] $PIP_INSTALL_SUFFIX
56

57
if [ "$IS_BLACKWELL" != "1" ]; then
fzyzcjy's avatar
fzyzcjy committed
58
59
    # For lmms_evals evaluating MMMU
    git clone --branch v0.3.3 --depth 1 https://github.com/EvolvingLMMs-Lab/lmms-eval.git
60
    $PIP_CMD install -e lmms-eval/ $PIP_INSTALL_SUFFIX
61

fzyzcjy's avatar
fzyzcjy committed
62
    # Install xformers
63
    $PIP_CMD install xformers --index-url https://download.pytorch.org/whl/${CU_VERSION} --no-deps $PIP_INSTALL_SUFFIX
fzyzcjy's avatar
fzyzcjy committed
64
fi
65

66
67
# Install FlashMLA for attention backend tests
# $PIP_CMD install git+https://github.com/deepseek-ai/FlashMLA.git $PIP_INSTALL_SUFFIX
Mick's avatar
Mick committed
68

69
# Show current packages
70
71
72
$PIP_CMD list

echo "CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-}"