Skip to content

Commit 28430ac

Browse files
committed
hpu nixl accuracy script changes
1 parent e7b89b5 commit 28430ac

File tree

1 file changed

+55
-16
lines changed

1 file changed

+55
-16
lines changed

tests/v1/kv_connector/nixl_integration/run_accuracy_test.sh

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ set -xe
55
MODELS=(
66
"Qwen/Qwen3-0.6B"
77
)
8+
MODELS=(
9+
"meta-llama/Llama-3.1-8B"
10+
)
11+
12+
export VLLM_SKIP_WARMUP="true"
13+
#export PT_HPU_LAZY_MODE=1
814

915
# Number of prefill and decode instances to create
1016
NUM_PREFILL_INSTANCES=${NUM_PREFILL_INSTANCES:-1} # Default to 1
@@ -13,9 +19,10 @@ PREFILLER_TP_SIZE=${PREFILLER_TP_SIZE:-1}
1319
DECODER_TP_SIZE=${DECODER_TP_SIZE:-1}
1420

1521
# Find the git repository root directory
16-
GIT_ROOT=$(git rev-parse --show-toplevel)
22+
#GIT_ROOT=$(git rev-parse --show-toplevel)
23+
GIT_ROOT="/home/vllm-nixl/vllm"
1724

18-
SMI_BIN=$(which nvidia-smi || which rocm-smi)
25+
#SMI_BIN=$(which nvidia-smi || which rocm-smi)
1926

2027
# Trap the SIGINT signal (triggered by Ctrl+C)
2128
trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT
@@ -25,7 +32,7 @@ wait_for_server() {
2532
local port=$1
2633
timeout 1200 bash -c "
2734
until curl -s localhost:${port}/v1/completions > /dev/null; do
28-
sleep 1
35+
sleep 1
2936
done" && return 0 || return 1
3037
}
3138

@@ -75,22 +82,24 @@ run_tests_for_model() {
7582
# Start prefill instances
7683
for i in $(seq 0 $((NUM_PREFILL_INSTANCES-1))); do
7784
# Calculate GPU ID - we'll distribute across available GPUs
78-
GPU_ID=$((i % $(get_num_gpus)))
85+
#GPU_ID=$((i % $(get_num_gpus)))
86+
GPU_ID=2
7987

8088
# Calculate port number (base port + instance number)
81-
PORT=$((8100 + i))
89+
PORT=$((8300 + i))
8290
# Calculate side channel port. Avoid clash with with TP workers.
83-
SIDE_CHANNEL_PORT=$((5559 + i))
91+
SIDE_CHANNEL_PORT=$((6559 + i))
8492

8593
echo "Starting prefill instance $i on GPU $GPU_ID, port $PORT"
8694

8795
# Build the command with or without model-specific args
8896
BASE_CMD="CUDA_VISIBLE_DEVICES=$GPU_ID VLLM_NIXL_SIDE_CHANNEL_PORT=$SIDE_CHANNEL_PORT vllm serve $model_name \
8997
--port $PORT \
9098
--enforce-eager \
91-
--gpu-memory-utilization 0.2 \
99+
--disable-log-requests \
100+
--gpu-memory-utilization 0.3 \
92101
--tensor-parallel-size $PREFILLER_TP_SIZE \
93-
--kv-transfer-config '{\"kv_connector\":\"NixlConnector\",\"kv_role\":\"kv_both\"}'"
102+
--kv-transfer-config '{\"kv_connector\":\"NixlConnector\",\"kv_role\":\"kv_both\",\"kv_buffer_device\":\"cpu\"}'"
94103

95104
if [ -n "$model_args" ]; then
96105
FULL_CMD="$BASE_CMD $model_args"
@@ -108,9 +117,10 @@ run_tests_for_model() {
108117
# Start decode instances
109118
for i in $(seq 0 $((NUM_DECODE_INSTANCES-1))); do
110119
# Calculate GPU ID - we'll distribute across available GPUs, starting from after prefill GPUs
111-
GPU_ID=$(((i + NUM_PREFILL_INSTANCES) % $(get_num_gpus)))
120+
#GPU_ID=$(((i + NUM_PREFILL_INSTANCES) % $(get_num_gpus)))
121+
GPU_ID=6
112122
# Calculate port number (base port + instance number)
113-
PORT=$((8200 + i))
123+
PORT=$((8400 + i))
114124
# Calculate side channel port
115125
SIDE_CHANNEL_PORT=$((5659 + i * $DECODER_TP_SIZE))
116126

@@ -120,9 +130,10 @@ run_tests_for_model() {
120130
BASE_CMD="CUDA_VISIBLE_DEVICES=$GPU_ID VLLM_NIXL_SIDE_CHANNEL_PORT=$SIDE_CHANNEL_PORT vllm serve $model_name \
121131
--port $PORT \
122132
--enforce-eager \
123-
--gpu-memory-utilization 0.2 \
133+
--disable-log-requests \
134+
--gpu-memory-utilization 0.3 \
124135
--tensor-parallel-size $DECODER_TP_SIZE \
125-
--kv-transfer-config '{\"kv_connector\":\"NixlConnector\",\"kv_role\":\"kv_both\"}'"
136+
--kv-transfer-config '{\"kv_connector\":\"NixlConnector\",\"kv_role\":\"kv_both\",\"kv_buffer_device\":\"cpu\"}'"
126137

127138
if [ -n "$model_args" ]; then
128139
FULL_CMD="$BASE_CMD $model_args"
@@ -149,7 +160,7 @@ run_tests_for_model() {
149160
done
150161

151162
# Build the command for the proxy server with all the hosts and ports
152-
PROXY_CMD="python ${GIT_ROOT}/tests/v1/kv_connector/nixl_integration/toy_proxy_server.py --port 8192"
163+
PROXY_CMD="python toy_proxy_server.py --port 9192"
153164

154165
# Add all prefill hosts and ports
155166
PROXY_CMD+=" --prefiller-hosts ${PREFILL_HOSTS[@]}"
@@ -164,11 +175,39 @@ run_tests_for_model() {
164175
$PROXY_CMD &
165176

166177
# Wait for the proxy to start
167-
sleep 5
168-
178+
sleep 10
179+
180+
# curl -X POST -s http://localhost:9192/v1/completions \
181+
# -H "Content-Type: application/json" \
182+
# -d '{
183+
# "model": "meta-llama/Llama-3.1-8B",
184+
# "prompt": "Mark Elliot Zuckerberg is an American businessman who co-founded the social media service Facebook and its parent company Meta Platforms, of which he is the chairman, chief executive officer, and controlling shareholder. Zuckerberg has been the subject of multiple lawsuits regarding the creation and ownership of the website as well as issues such as user privacy. Born in White Plains, New York, Zuckerberg briefly attended Harvard College, where he launched Facebook in February 2004 with his roommates Eduardo Saverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes. Zuckerberg took the company public in May 2012 with majority shares. He became the worlds youngest self-made billionaire[a] in 2008, at age 23, and has consistently ranked among the worlds wealthiest individuals. According to Forbes, Zuckerbergs estimated net worth stood at US$221.2 billion as of May 2025, making him the second-richest individual in the world.[2]",
185+
# "max_tokens": 5,
186+
# "temperature": 0
187+
# }'
188+
sleep 5
189+
echo "--------------------===================-------------"
190+
curl -X POST -s http://localhost:9192/v1/completions \
191+
-H "Content-Type: application/json" \
192+
-d '{
193+
"model": "meta-llama/Llama-3.1-8B",
194+
"prompt": "Mark Elliot Zuckerberg is an American businessman who co-founded the social media service Facebook and its parent company Meta Platforms, of which he is the chairman, chief executive officer, and controlling shareholder. Zuckerberg has been the subject of multiple lawsuits regarding the creation and ownership of the website as well as issues such as user privacy. Born in White Plains, New York, Zuckerberg briefly attended Harvard College, where he launched Facebook in February 2004 with his roommates Eduardo Saverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes. Zuckerberg took the company public in May 2012 with majority shares. He became the worlds youngest self-made billionaire[a] in 2008, at age 23, and has consistently ranked among the worlds wealthiest individuals. According to Forbes, Zuckerbergs estimated net worth stood at US$221.2 billion as of May 2025, making him the second-richest individual in the world.[2] Intel opened its first international manufacturing facility in 1972, in Malaysia, which would host multiple Intel operations, before opening assembly facilities and semiconductor plants in Singapore and Jerusalem in the early 1980s, and manufacturing and development centers in China, India, and Costa Rica in the 1990s.[31] By the early 1980s, its business was dominated by DRAM chips. However, increased competition from Japanese semiconductor manufacturers had, by 1983, dramatically reduced the profitability of this market. The growing success of the IBM personal computer, based on an Intel microprocessor, was among factors that convinced Gordon Moore (CEO since 1975) to shift the companys focus to microprocessors and to change fundamental aspects of that business model. Moores decision to sole-source Intels 386 chip played into the companys continuing success.",
195+
"max_tokens": 5,
196+
"temperature": 0
197+
}'
198+
curl -X POST -s http://localhost:9192/v1/completions \
199+
-H "Content-Type: application/json" \
200+
-d '{
201+
"model": "meta-llama/Llama-3.1-8B",
202+
"prompt": ["This was a few months ago. It was my day off and the only thing I had to do was pick my girlfriend up from work at 9:00 pm. Other than that, I was free to loaf on the couch from morning to night, which is what I did. Around 8:00, I decided to shower before I left the house. Now, I have short hair that dries pretty quickly, but I am deeply vain about it, so I always dry it with the hairdryer right after I shower to ensure my hair doesnt get flat and weird. I never skip this step. So, I get out of the shower, start drying my hair... And then I wake up in bed. Its half an hour later. I feel like garbage, my entire body mysteriously hurts, and I am slowly realizing that I dont remember exiting the bathroom. My only clear thought is: oh shit, its 9:00! I have to pick up my girlfriend! Better shake myself awake. I dragged my aching carcass back to the bathroom, and this was when I noticed the massive blisters forming all over my hand. I was still pretty out of it, but I knew that this was a hospital visit kind of burn. My girlfriend then called to check in because I was running late and, despite my undoubtedly convincing argument that I was still perfectly fine to drive, she immediately knew something was wrong. She cabbed home and we got a ride to the ER. Turns out, I had my first ever seizure! It seems like during the seizure, I clenched the hairdryer in my fist and had it pointed at my other hand long enough to thoroughly cook it. The tissue loss is pretty deep in some areas and there was concerns about me retaining my mobility, but its been healing well so far.",
203+
"Mark Elliot Zuckerberg is an American businessman who co-founded the social media service Facebook and its parent company Meta Platforms, of which he is the chairman, chief executive officer, and controlling shareholder. Zuckerberg has been the subject of multiple lawsuits regarding the creation and ownership of the website as well as issues such as user privacy. Born in White Plains, New York, Zuckerberg briefly attended Harvard College, where he launched Facebook in February 2004 with his roommates Eduardo Saverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes. Zuckerberg took the company public in May 2012 with majority shares. He became the worlds youngest self-made billionaire[a] in 2008, at age 23, and has consistently ranked among the worlds wealthiest individuals. According to Forbes, Zuckerbergs estimated net worth stood at US$221.2 billion as of May 2025, making him the second-richest individual in the world.[2]"],
204+
"max_tokens": 2,
205+
"temperature": 0
206+
}'
207+
#sleep 10000
169208
# Run lm eval for this model
170209
echo "Running tests for $model_name"
171-
TEST_MODEL=$model_name python -m pytest -s -x ${GIT_ROOT}/tests/v1/kv_connector/nixl_integration/test_accuracy.py
210+
TEST_MODEL=$model_name python -m pytest -s -x test_accuracy.py
172211

173212
# Clean up before running next model
174213
cleanup_instances

0 commit comments

Comments
 (0)