Skip to content

Commit 4e860ce

Browse files
authored
Merge pull request #44 from purdue-aalp/vllm_add
adding vllm
2 parents f802793 + aeccc81 commit 4e860ce

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

src/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $(error You must run "source setup_environment before calling make")
44
endif
55

66
ifeq ($(CUDA_GT_7), 1)
7-
all: GPU_Microbenchmark microbench rodinia_2.0-ft cutlass rodinia-3.1 pannotia proxy-apps ispass-2009 lonestargpu-2.0 polybench custom_apps heterosync cuda_samples mlperf_inference # mlperf_training
7+
all: GPU_Microbenchmark microbench rodinia_2.0-ft cutlass rodinia-3.1 pannotia proxy-apps ispass-2009 lonestargpu-2.0 polybench custom_apps heterosync cuda_samples mlperf_inference vllm # mlperf_training
88
#all: pannotia rodinia_2.0-ft proxy-apps microbench rodinia-3.1 ispass-2009 lonestargpu-2.0 polybench parboil shoc custom_apps deeplearning cutlass GPU_Microbenchmark heterosync Deepbench_nvidia dragon-naive dragon-cdp
99
else
1010
ifeq ($(CUDA_GT_4), 1)
@@ -481,6 +481,14 @@ mlperf_inference:
481481
cd $(BINDIR)/$(BINSUBDIR)/mlperf_inference && sh ./install_mlperf_and_virtual_environments_inference.sh | tee $(BINDIR)/$(BINSUBDIR)/mlperf_inference/mlperf_install_inference.log
482482
cd $(BINDIR)/$(BINSUBDIR)/mlperf_inference && rm install_mlperf_and_virtual_environments_inference.sh
483483

484+
485+
vllm:
486+
mkdir -p $(BINDIR)/$(BINSUBDIR)/vllm
487+
cp cuda/vllm/install_vllm.sh $(BINDIR)/$(BINSUBDIR)/vllm
488+
cd $(BINDIR)/$(BINSUBDIR)/vllm && sh ./install_vllm.sh | tee $(BINDIR)/$(BINSUBDIR)/vllm/vllm_install.log
489+
cd $(BINDIR)/$(BINSUBDIR)/vllm && rm install_vllm.sh
490+
491+
484492
mlperf_training:
485493
mkdir -p $(BINDIR)/$(BINSUBDIR)/
486494
cp cuda/mlperf/install_mlperf_and_virtual_environments_training.sh $(BINDIR)/$(BINSUBDIR)/

src/cuda/vllm/install_vllm.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
# exit when any command fails
3+
set -e
4+
5+
ENV_NAME="vllm-env"
6+
VLLM_REPO_DIR="vllm"
7+
8+
if [ ! -d "./$ENV_NAME" ]; then
9+
echo "create virtual environment"
10+
python3 -m venv $ENV_NAME
11+
fi
12+
export PATH="$PWD/$ENV_NAME/bin:$PATH"
13+
. $ENV_NAME/bin/activate
14+
pip install --upgrade pip
15+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
16+
pip install vllm
17+
pip install -U "huggingface_hub[cli]"
18+
echo "[+] Verifying installation..."
19+
python -c "import torch; print('Torch:', torch.__version__); import vllm; print('vLLM:', vllm.__version__)"
20+
echo "[+] Cloning vllm repo and setting up sparse-checkout"
21+
if [ ! -d "$VLLM_REPO_DIR" ]; then
22+
# Clone vllm repository with sparse-checkout
23+
git clone --depth 1 --filter=blob:none --sparse https://github.com/vllm-project/vllm.git
24+
cd vllm
25+
26+
# Initialize sparse-checkout and set to only checkout 'benchmark' directory
27+
git sparse-checkout init --cone
28+
git sparse-checkout set benchmarks
29+
else
30+
echo "[=] Repo '$VLLM_REPO_DIR' already exists, skipping clone"
31+
fi
32+
33+
echo "[+] Downloading the benchmark directory..."
34+
cd ..
35+
36+
echo "[+] Deactivating virtual environment"
37+
deactivate
38+
echo "[✓] Setup complete. Virtual environment deactivated, and 'benchmark/' downloaded."

0 commit comments

Comments
 (0)