Update validation script to use frank-default-small model name

This commit is contained in:
Frank committed 2026-08-08 10:38:30 -07:00
1 parent 35bd22cd75
commit dd19627635
1 file changed
+49 -32
+49 -32
View File
@@ -1,10 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# End-to-end validation test for vLLM Qwen3.6-35B-A3B-FP8 on dankserver # End-to-end validation test for vLLM Qwen3.6-35B-A3B-FP8
# Measures prompt processing speed (tokens/second) # Tests single stream and 4 parallel streams
set -euo pipefail set -euo pipefail
HOST="${1:-127.0.0.1}" HOST="${1:-127.0.0.1}"
PORT="${2:-8001}" PORT="${2:-8001}"
NUM_STREAMS=4
echo "=== Validating vLLM on ${HOST}:${PORT} ===" echo "=== Validating vLLM on ${HOST}:${PORT} ==="
@@ -15,54 +16,70 @@ if ! curl -sf "http://${HOST}:${PORT}/health" > /dev/null 2>&1; then
exit 1 exit 1
fi fi
# Test chat completions with timing # Single stream test
echo "Running prompt test..." echo "Single stream test..."
START=$(date +%s%N) START=$(date +%s%N)
RESPONSE=$(curl -s -X POST "http://${HOST}:${PORT}/v1/chat/completions" \ RESPONSE=$(curl -s -X POST "http://${HOST}:${PORT}/v1/chat/completions" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"model": "Qwen/Qwen3.6-35B-A3B-FP8", "model": "frank-default-small",
"messages": [ "messages": [
{"role": "user", "content": "Explain the difference between supervised, unsupervised, and reinforcement learning in machine learning. For each type, provide a concrete real-world example, describe the training process, and discuss the advantages and limitations. Then compare them across three dimensions: data requirements, interpretability of results, and computational cost. Finally, describe a hybrid scenario where combining two of these approaches would outperform using either alone."} {"role": "user", "content": "Explain the difference between supervised, unsupervised, and reinforcement learning in machine learning. For each type, provide a concrete real-world example, describe the training process, and discuss the advantages and limitations. Then compare them across three dimensions: data requirements, interpretability of results, and computational cost. Finally, describe a hybrid scenario where combining two of these approaches would outperform using either alone."}
], ],
"max_tokens": 256 "max_tokens": 256
}') }')
END=$(date +%s%N) END=$(date +%s%N)
ELAPSED_MS=$(( (END - START) / 1000000 )) ELAPSED_MS=$(( (END - START) / 1000000 ))
# Extract metrics from response
PROMPT_TOKENS=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['usage']['prompt_tokens'])") PROMPT_TOKENS=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['usage']['prompt_tokens'])")
COMPLETION_TOKENS=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['usage']['completion_tokens'])") COMPLETION_TOKENS=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['usage']['completion_tokens'])")
CONTENT=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['choices'][0]['message']['content'][:100])") SINGLE_SPEED=$(python3 -c "print(f'{${PROMPT_TOKENS}/${ELAPSED_MS}*1000:.2f}')")
echo "Single stream: ${SINGLE_SPEED} tok/s (prompt)"
# Calculate speed # Parallel streams test
if [ "$ELAPSED_MS" -gt 0 ]; then echo "Parallel streams test (${NUM_STREAMS} streams)..."
PROMPT_SPEED=$(python3 -c "print(f'{${PROMPT_TOKENS}/${ELAPSED_MS}*1000:.2f}')") START=$(date +%s%N)
COMPLETION_SPEED=$(python3 -c "print(f'{${COMPLETION_TOKENS}/${ELAPSED_MS}*1000:.2f}')") TMPDIR=$(mktemp -d)
else for i in $(seq 1 $NUM_STREAMS); do
PROMPT_SPEED="N/A" curl -s -X POST "http://${HOST}:${PORT}/v1/chat/completions" \
COMPLETION_SPEED="N/A" -H "Content-Type: application/json" \
fi -d '{
"model": "frank-default-small",
"messages": [
{"role": "user", "content": "Explain the difference between supervised, unsupervised, and reinforcement learning in machine learning. For each type, provide a concrete real-world example, describe the training process, and discuss the advantages and limitations. Then compare them across three dimensions: data requirements, interpretability of results, and computational cost. Finally, describe a hybrid scenario where combining two of these approaches would outperform using either alone."}
],
"max_tokens": 256
}' > "$TMPDIR/$i.json" &
done
wait
END=$(date +%s%N)
ELAPSED_MS=$(( (END - START) / 1000000 ))
# Aggregate results from all streams
TOTAL_PROMPT=0
TOTAL_COMPLETION=0
for i in $(seq 1 $NUM_STREAMS); do
PT=$(python3 -c "import json; print(json.load(open('$TMPDIR/$i.json'))['usage']['prompt_tokens'])")
CT=$(python3 -c "import json; print(json.load(open('$TMPDIR/$i.json'))['usage']['completion_tokens'])")
TOTAL_PROMPT=$((TOTAL_PROMPT + PT))
TOTAL_COMPLETION=$((TOTAL_COMPLETION + CT))
done
rm -rf "$TMPDIR"
PARALLEL_SPEED=$(python3 -c "print(f'{${TOTAL_PROMPT}/${ELAPSED_MS}*1000:.2f}')")
echo "" echo ""
echo "=== Results ===" echo "=== Results ==="
echo "Prompt tokens: ${PROMPT_TOKENS}" echo "Single stream prompt speed: ${SINGLE_SPEED} tok/s"
echo "Completion tokens: ${COMPLETION_TOKENS}" echo "Parallel streams prompt speed: ${PARALLEL_SPEED} tok/s (${NUM_STREAMS} streams, ${TOTAL_PROMPT} total prompt tokens)"
echo "Total time: ${ELAPSED_MS}ms" echo "Parallel completion speed: $(python3 -c "print(f'{${TOTAL_COMPLETION}/${ELAPSED_MS}*1000:.2f}')") tok/s"
echo "Prompt speed: ${PROMPT_SPEED} tok/s" echo "Total parallel time: ${ELAPSED_MS}ms"
echo "Completion speed: ${COMPLETION_SPEED} tok/s"
echo "Sample output: ${CONTENT}..."
echo "" echo ""
# Fail if prompt speed < 5 tok/s # Fail if parallel speed < 5 tok/s
if [ "$ELAPSED_MS" -gt 0 ] && [ "$PROMPT_TOKENS" -gt 0 ]; then if python3 -c "import sys; sys.exit(0 if ${TOTAL_PROMPT}/${ELAPSED_MS}*1000 >= 5 else 1)"; then
TOO_SLOW=$(python3 -c "print('yes' if ${PROMPT_TOKENS}/${ELAPSED_MS}*1000 < 5 else 'no')") echo "PASS: Validation successful"
if [ "$TOO_SLOW" = "yes" ]; then echo "$PARALLEL_SPEED" > /tmp/vllm_prompt_speed.txt
echo "FAIL: Prompt speed ${PROMPT_SPEED} tok/s is below 5 tok/s threshold" else
echo "FAIL: Parallel prompt speed ${PARALLEL_SPEED} tok/s is below 5 tok/s threshold"
exit 1 exit 1
fi fi
fi
echo "PASS: Validation successful"
echo "$PROMPT_SPEED" > /tmp/vllm_prompt_speed.txt