forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from ROCmSoftwarePlatform/vllm_v4
V4 update
- Loading branch information
Showing
5 changed files
with
46 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,13 +30,21 @@ RUN git clone https://streamhsa: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@github. | |
cd vllm-private &&\ | ||
pip install -r requirements.txt &&\ | ||
pip install typing-extensions==4.8.0 &&\ | ||
sed -i 's/gpu_memory_utilization: float = 0.9/gpu_memory_utilization: float = 0.4/g' vllm/engine/arg_utils.py &&\ | ||
python setup.py build && python setup.py develop; exit 0 | ||
RUN pip install pyarrow Ray | ||
RUN pip install pandas | ||
RUN pip install pyarrow Ray pandas==2.0 numpy==1.20.3 | ||
|
||
# RUN git clone -b N1 https://streamhsa:[email protected]/amgddm/rocBLAS-internal.git && \ | ||
# cd rocBLAS-internal && ./install.sh -idc -a gfx942 &&\ | ||
# cd ../ && rm -rf rocBLAS-internal | ||
RUN cd ~ && wget --no-check-certificate \ | ||
https://compute-artifactory.amd.com/artifactory/list/rocm-osdb-20.04-deb/compute-rocm-dkms-no-npi-hipclang-12845/hsa-rocr_1.12.0.60000-crdnnh.12845%7E20.04_amd64.deb &&\ | ||
dpkg-deb -x hsa-rocr_1.12.0.60000-crdnnh.12845~20.04_amd64.deb . && \ | ||
cp opt/rocm-6.0.0-12845/lib/* /opt/rocm-6.0.0-12969/lib/ && rm -rf opt/rocm-6.0.0-12845 | ||
|
||
ENV HSA_OVERRIDE_GFX_VERSION=9.4.1 | ||
|
||
RUN rm /opt/rocm/share/rccl/msccl-algorithms/allreduce-allpairs-8n-simple.xml | ||
|
||
COPY run_vllm.sh $WORKSPACE_DIR/ | ||
COPY run_vllm_tp1.sh $WORKSPACE_DIR/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,31 @@ | ||
#!/bin/bash | ||
# parameter defalt values | ||
tp=1 | ||
VLLM_DIR=$HOME/vllm | ||
GRAD_DIR=$HOME/gradlib | ||
MODEL=/data/llama-2-13b-chat-hf | ||
|
||
# pring usage of the parameters | ||
usage() { | ||
echo "Usage: $0 [--tp <n>] [--vllm_dir <path>] [--gradlib_dir <path>] [--model <path>]" | ||
exit 1 | ||
} | ||
|
||
# parse parameters | ||
while [[ "$#" -gt 0 ]]; do | ||
case $1 in | ||
--tp) tp="$2"; shift ;; | ||
--vllm_dir) VLLM_DIR="$2"; shift ;; | ||
--gradlib_dir) GRAD_DIR="$2"; shift ;; | ||
--model) MODEL="$2"; shift ;; | ||
*) usage ;; # Any other argument will show usage information. | ||
esac | ||
shift # Move to next argument | ||
done | ||
|
||
# print parameter settings | ||
echo "tensor parallel: $tp" | ||
echo "vllm_dir: $VLLM_DIR" | ||
echo "gradlib_dir: $GRAD_DIR" | ||
echo "model: $MODEL" | ||
|
||
SLOT_DIR=/workspace | ||
VLLM_DIR=$SLOT_DIR/vllm-private | ||
GRAD_DIR=$SLOT_DIR/gradlib | ||
MODEL=/data/llama2-70b-chat | ||
#enable to use triton flash attention | ||
export VLLM_USE_TRITON=1 | ||
export VLLM_USE_HIPGRAPH=1 | ||
|
||
export VLLM_USE_HIPGRAPH= | ||
#export LD_LIBRARY_PATH=/var/lib/jenkins/rccl/build | ||
#set Tensor Parallelism | ||
echo "tuned_gemm_csv: ./tuned_tp$tp.csv" > $VLLM_DIR/tuned_perf_tp$tp.yaml | ||
if [ ! -f $VLLM_DIR/tuned_tp$tp.csv ] ; | ||
then | ||
echo "INFO: No Tuned configs detected. Generating now" | ||
cd $GRAD_DIR | ||
python gemm_tuner.py --model_dir $MODEL --output ../vllm/tuned_tp$tp.csv --tp $tp | ||
fi | ||
export VLLM_PERF_YAML=./tuned_perf_tp$tp.yaml | ||
|
||
cd $VLLM_DIR | ||
for gen_len in 1 32; | ||
for tp in 1; | ||
do | ||
for input_len in 512 1024 2048 3072; | ||
echo "tuned_gemm_csv: ./tuned_tp$tp.csv" > $VLLM_DIR/tuned_perf_tp$tp.yaml | ||
if [ ! -f $VLLM_DIR/tuned_tp$tp.csv ] ; | ||
then | ||
echo "INFO: No Tuned configs detected. Generating now" | ||
cd $GRAD_DIR | ||
python gemm_tuner.py --model_dir $MODEL --output $VLLM_DIR/tuned_tp$tp.csv --tp $tp | ||
fi | ||
export VLLM_PERF_YAML=./tuned_perf_tp$tp.yaml | ||
|
||
cd $VLLM_DIR | ||
for gen_len in 1 32; | ||
do | ||
echo "================================= RUNNING $MODEL tp$tp $input_len $gen_len ===============================================" | ||
python benchmarks/benchmark_latency.py --model $MODEL --input-len $input_len --output-len $gen_len --batch-size 1 --tensor-parallel-size $tp --num-iters 5 | ||
for input_len in 512 1024 2048 3072; | ||
do | ||
echo "================================= RUNNING $MODEL $input_len $gen_len ===============================================" | ||
python benchmarks/benchmark_latency.py --model $MODEL --input-len $input_len --output-len $gen_len --batch-size 1 --tensor-parallel-size $tp --num-iters 5 | ||
done | ||
done | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters