ci_install_dependency.sh 1.86 KB
Newer Older
1
#!/bin/bash
2
# Install the dependency in CI.
3
set -euxo pipefail
Lianmin Zheng's avatar
Lianmin Zheng committed
4

fzyzcjy's avatar
fzyzcjy committed
5
6
7
8
9
10
11
MODE_BLACKWELL=${MODE_BLACKWELL:-0}

CU_VERSION="cu126"
if [ "$MODE_BLACKWELL" = "1" ]; then
    CU_VERSION="cu129"
fi

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

fzyzcjy's avatar
fzyzcjy committed
16
17
18
19
20
if ! command -v git >/dev/null 2>&1; then
    apt update
    apt install -y git
fi

21
# Update pip
fzyzcjy's avatar
fzyzcjy committed
22
if [ "$MODE_BLACKWELL" != "1" ]; then
Cheng Wan's avatar
Cheng Wan committed
23
    pip install --upgrade pip
fzyzcjy's avatar
fzyzcjy committed
24
fi
25

Xiaoyu Zhang's avatar
Xiaoyu Zhang committed
26
# Clean up existing installations
fzyzcjy's avatar
fzyzcjy committed
27
pip uninstall -y flashinfer flashinfer_python sgl-kernel sglang vllm --break-system-packages || true
28
pip cache purge || true
Xiaoyu Zhang's avatar
Xiaoyu Zhang committed
29
rm -rf /root/.cache/flashinfer
fzyzcjy's avatar
fzyzcjy committed
30
# TODO handle other python versions
Xiaoyu Zhang's avatar
Xiaoyu Zhang committed
31
32
33
34
rm -rf /usr/local/lib/python3.10/dist-packages/flashinfer*
rm -rf /usr/local/lib/python3.10/dist-packages/sgl_kernel*

# Install the main package
fzyzcjy's avatar
fzyzcjy committed
35
pip install -e "python[dev]" --extra-index-url https://download.pytorch.org/whl/test/${CU_VERSION} --break-system-packages
Xiaoyu Zhang's avatar
Xiaoyu Zhang committed
36

37
38
39
# Show current packages
pip list

Xiaoyu Zhang's avatar
Xiaoyu Zhang committed
40
# Install additional dependencies
fzyzcjy's avatar
fzyzcjy committed
41
pip install mooncake-transfer-engine==0.3.5 nvidia-cuda-nvrtc-cu12 --break-system-packages
42

fzyzcjy's avatar
fzyzcjy committed
43
44
45
46
47
if [ "$MODE_BLACKWELL" != "1" ]; then
    # For lmms_evals evaluating MMMU
    git clone --branch v0.3.3 --depth 1 https://github.com/EvolvingLMMs-Lab/lmms-eval.git
    pip install -e lmms-eval/ --break-system-packages
fi
48
49

# Install FlashMLA for attention backend tests
fzyzcjy's avatar
fzyzcjy committed
50
# pip install git+https://github.com/deepseek-ai/FlashMLA.git --break-system-packages
Yineng Zhang's avatar
Yineng Zhang committed
51
52

# Install hf_xet
fzyzcjy's avatar
fzyzcjy committed
53
pip install huggingface_hub[hf_xet] --break-system-packages
54

fzyzcjy's avatar
fzyzcjy committed
55
56
57
58
if [ "$MODE_BLACKWELL" != "1" ]; then
    # Install xformers
    pip install -U xformers --index-url https://download.pytorch.org/whl/${CU_VERSION} --no-deps --force-reinstall --break-system-packages
fi
59

Mick's avatar
Mick committed
60
# To help dumping traces when timeout occurred
fzyzcjy's avatar
fzyzcjy committed
61
pip install py-spy --break-system-packages
Mick's avatar
Mick committed
62

63
64
# Show current packages
pip list