Skip to content
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
11 changes: 8 additions & 3 deletions examples/backends/vllm/launch/agg_spec_decoding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ trap 'echo Cleaning up...; kill 0' EXIT

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
source "$SCRIPT_DIR/../../../common/launch_utils.sh"
source "$SCRIPT_DIR/../../../common/gpu_utils.sh" # build_vllm_gpu_mem_args

# When the serve test sets requested_vllm_kv_cache_bytes, this emits a
# --kv-cache-memory-bytes cap so VRAM is bounded (GPU-size-independent) and the
# test can run in the VRAM-aware parallel stage. Empty for manual runs.
GPU_MEM_ARGS=$(build_vllm_gpu_mem_args)

MODEL="meta-llama/Meta-Llama-3.1-8B-Instruct"
HTTP_PORT="${DYN_HTTP_PORT:-8000}"
Expand All @@ -21,8 +27,7 @@ python -m dynamo.frontend --http-port="$HTTP_PORT" &
# 2. Speculative Main Worker
# ---------------------------
# This runs the main model with EAGLE as the draft model for speculative decoding
# TODO: use build_vllm_gpu_mem_args to measure VRAM instead of hardcoded fractions
DYN_SYSTEM_ENABLED=true DYN_SYSTEM_PORT=8081 \
DYN_SYSTEM_ENABLED=true DYN_SYSTEM_PORT=${DYN_SYSTEM_PORT:-8081} \
CUDA_VISIBLE_DEVICES=0 python -m dynamo.vllm \
--model "$MODEL" \
--enforce-eager \
Expand All @@ -32,7 +37,7 @@ CUDA_VISIBLE_DEVICES=0 python -m dynamo.vllm \
"num_speculative_tokens": 2,
"method": "eagle3"
}' \
--gpu-memory-utilization 0.8 &
--gpu-memory-utilization 0.8 $GPU_MEM_ARGS "$@" &

# Exit on first worker failure; kill 0 in the EXIT trap tears down the rest
wait_any_exit
36 changes: 36 additions & 0 deletions tests/serve/test_vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,42 @@ class VLLMConfig(EngineConfig):
metric_payload_default(min_num_requests=6, backend="vllm"),
],
),
# Speculative decoding: Llama-3.1-8B main model with an EAGLE3 draft model
# (see launch/agg_spec_decoding.sh). The base model is gated on HF, so this
# needs HF_TOKEN set and only runs where the token + VRAM are available.
# Nightly-only: the 8B base plus EAGLE3 draft model is intentionally outside pre-merge CI.
"aggregated_spec_decoding": VLLMConfig(
name="aggregated_spec_decoding",
directory=vllm_dir,
script_name="agg_spec_decoding.sh",
marks=[
pytest.mark.gpu_1,
# Also predownload the EAGLE3 draft: CI workers run HF_HUB_OFFLINE=True
# and only the base cfg.model is auto-registered, so the draft repo
# can't be resolved offline without this.
pytest.mark.model("yuhuili/EAGLE3-LLaMA3.1-Instruct-8B"),
# Profiled with a 1 GiB KV cap (peak ~18.6 GiB: 8B weights + EAGLE3
Comment thread
nv-tusharma marked this conversation as resolved.
# draft + capped KV). The byte cap (build_vllm_gpu_mem_args) makes
# this GPU-size-independent, so it fits the 24 GiB parallel stage.
pytest.mark.profiled_vram_gib(20.0),
pytest.mark.requested_vllm_kv_cache_bytes(1_073_741_824),
pytest.mark.timeout(900),
pytest.mark.nightly,
],
model="meta-llama/Meta-Llama-3.1-8B-Instruct",
# 8B weights leave little KV room on the 24 GiB gpu_1 lane; cap context (payloads are tiny).
script_args=["--max-model-len", "4096"],
request_payloads=[
chat_payload_default(),
chat_payload(
"What is the capital of France? Answer in one word.",
repeat_count=1,
expected_response=["Paris"],
temperature=0.0,
max_tokens=16,
),
],
),
"aggregated_unified": VLLMConfig(
Comment thread
nv-tusharma marked this conversation as resolved.
name="aggregated_unified",
directory=vllm_dir,
Expand Down
Loading