Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vLLM multi gpu tests adjustments #65

Merged
merged 7 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 98 additions & 5 deletions ci/L0_multi_gpu/multi_lora/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ cp -r ${SAMPLE_MODELS_REPO}/vllm_model models/vllm_llama_multi_lora

export SERVER_ENABLE_LORA=true

# Check boolean flag value for `enable_lora`
model_json=$(cat <<EOF
{
"model":"./weights/backbone/gemma-2b",
"disable_log_requests": "true",
"disable_log_requests": true,
"gpu_memory_utilization": 0.7,
"tensor_parallel_size": 2,
"block_size": 16,
"enforce_eager": "true",
"enable_lora": "true",
"enforce_eager": true,
"enable_lora": true,
"max_lora_rank": 32,
"lora_extra_vocab_size": 256,
"distributed_executor_backend":"ray"
Expand Down Expand Up @@ -110,16 +111,108 @@ set -e
kill $SERVER_PID
wait $SERVER_PID

# Check string flag value for `enable_lora`
model_json=$(cat <<EOF
{
"model":"./weights/backbone/gemma-2b",
"disable_log_requests": true,
"gpu_memory_utilization": 0.7,
"tensor_parallel_size": 2,
"block_size": 16,
"enforce_eager": true,
"enable_lora": "true",
"max_lora_rank": 32,
"lora_extra_vocab_size": 256,
"distributed_executor_backend":"ray"
}
EOF
)
echo "$model_json" > models/vllm_llama_multi_lora/1/model.json

run_server
if [ "$SERVER_PID" == "0" ]; then
cat $SERVER_LOG
echo -e "\n***\n*** Failed to start $SERVER\n***"
exit 1
fi

set +e
python3 $CLIENT_PY -v > $CLIENT_LOG 2>&1

if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Running $CLIENT_PY FAILED. \n***"
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Test Result Verification FAILED.\n***"
RET=1
fi
fi
set -e

kill $SERVER_PID
wait $SERVER_PID

# disable lora
export SERVER_ENABLE_LORA=false
# check bool flag value for `enable_lora`
model_json=$(cat <<EOF
{
"model":"./weights/backbone/gemma-2b",
"disable_log_requests": true,
"gpu_memory_utilization": 0.8,
"tensor_parallel_size": 2,
"block_size": 16,
"enforce_eager": true,
"enable_lora": false,
"lora_extra_vocab_size": 256,
"distributed_executor_backend":"ray"
}
EOF
)
echo "$model_json" > models/vllm_llama_multi_lora/1/model.json

run_server
if [ "$SERVER_PID" == "0" ]; then
cat $SERVER_LOG
echo -e "\n***\n*** Failed to start $SERVER\n***"
exit 1
fi

set +e
python3 $CLIENT_PY -v >> $CLIENT_LOG 2>&1

if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Running $CLIENT_PY FAILED. \n***"
RET=1
else
check_test_results $TEST_RESULT_FILE $EXPECTED_NUM_TESTS
if [ $? -ne 0 ]; then
cat $CLIENT_LOG
echo -e "\n***\n*** Test Result Verification FAILED.\n***"
RET=1
fi
fi
set -e

kill $SERVER_PID
wait $SERVER_PID

# disable lora
export SERVER_ENABLE_LORA=false
# check string flag value for `enable_lora`
model_json=$(cat <<EOF
{
"model":"./weights/backbone/gemma-2b",
"disable_log_requests": "true",
"disable_log_requests": true,
"gpu_memory_utilization": 0.8,
"tensor_parallel_size": 2,
"block_size": 16,
"enforce_eager": "true",
"enforce_eager": true,
"enable_lora": "false",
"lora_extra_vocab_size": 256,
"distributed_executor_backend":"ray"
Expand Down
4 changes: 3 additions & 1 deletion src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,11 @@ def init_engine(self):
def setup_lora(self):
self.enable_lora = False

# Check if `enable_lora` field is in the `model.json`,
# and if it is, read its contents, which can be string or bool.
if (
"enable_lora" in self.vllm_engine_config.keys()
and self.vllm_engine_config["enable_lora"].lower() == "true"
and str(self.vllm_engine_config["enable_lora"]).lower() == "true"
):
# create Triton LoRA weights repository
multi_lora_args_filepath = os.path.join(
Expand Down
Loading