diff --git a/.buildkite/test_areas/distributed.yaml b/.buildkite/test_areas/distributed.yaml index 4fac613c3515..c175f6f8f1a3 100644 --- a/.buildkite/test_areas/distributed.yaml +++ b/.buildkite/test_areas/distributed.yaml @@ -181,10 +181,10 @@ steps: num_devices: 4 source_file_dependencies: - vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py - - tests/v1/kv_connector/nixl_integration/ + - tests/v1/kv_connector/pd_integration/ commands: - uv pip install --system -r /vllm-workspace/requirements/kv_connectors.txt - - bash v1/kv_connector/nixl_integration/config_sweep_accuracy_test.sh + - bash v1/kv_connector/pd_integration/config_sweep_accuracy_test.sh - label: DP EP Distributed NixlConnector PD accuracy tests (4 GPUs) timeout_in_minutes: 30 @@ -192,10 +192,22 @@ steps: num_devices: 4 source_file_dependencies: - vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py - - tests/v1/kv_connector/nixl_integration/ + - tests/v1/kv_connector/pd_integration/ commands: - uv pip install --system -r /vllm-workspace/requirements/kv_connectors.txt - - DP_EP=1 bash v1/kv_connector/nixl_integration/config_sweep_accuracy_test.sh + - DP_EP=1 bash v1/kv_connector/pd_integration/config_sweep_accuracy_test.sh + +- label: P2pNccl Connector PD accuracy (2 GPUs) + timeout_in_minutes: 25 + working_dir: "/vllm-workspace/tests" + num_devices: 2 + optional: true + source_file_dependencies: + - vllm/distributed/kv_transfer/kv_connector/v1/p2p/ + - tests/v1/kv_connector/pd_integration/ + - benchmarks/disagg_benchmarks/disagg_prefill_proxy_server.py + commands: + - GPU_MEMORY_UTILIZATION=0.4 bash v1/kv_connector/pd_integration/run_p2p_nccl_accuracy_test.sh - label: Pipeline + Context Parallelism (4 GPUs)) timeout_in_minutes: 60 diff --git a/tests/v1/kv_connector/nixl_integration/config_sweep_accuracy_test.sh b/tests/v1/kv_connector/pd_integration/config_sweep_accuracy_test.sh similarity index 100% rename from tests/v1/kv_connector/nixl_integration/config_sweep_accuracy_test.sh rename to tests/v1/kv_connector/pd_integration/config_sweep_accuracy_test.sh diff --git a/tests/v1/kv_connector/nixl_integration/run_accuracy_test.sh b/tests/v1/kv_connector/pd_integration/run_accuracy_test.sh similarity index 100% rename from tests/v1/kv_connector/nixl_integration/run_accuracy_test.sh rename to tests/v1/kv_connector/pd_integration/run_accuracy_test.sh diff --git a/tests/v1/kv_connector/nixl_integration/run_edge_case_test.sh b/tests/v1/kv_connector/pd_integration/run_edge_case_test.sh similarity index 100% rename from tests/v1/kv_connector/nixl_integration/run_edge_case_test.sh rename to tests/v1/kv_connector/pd_integration/run_edge_case_test.sh diff --git a/tests/v1/kv_connector/pd_integration/run_p2p_nccl_accuracy_test.sh b/tests/v1/kv_connector/pd_integration/run_p2p_nccl_accuracy_test.sh new file mode 100755 index 000000000000..9c2f78d5cc2c --- /dev/null +++ b/tests/v1/kv_connector/pd_integration/run_p2p_nccl_accuracy_test.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright contributors to the vLLM project + +# P2pNccl Connector accuracy test script +# Uses disagg_prefill_proxy_server.py which encodes KV addresses in request IDs + +set -xe + +# Required for NCCL on some systems (consistent with other distributed tests) +export NCCL_CUMEM_HOST_ENABLE=0 + +MODEL_NAME=${MODEL_NAME:-"Qwen/Qwen3-0.6B"} +GPU_MEMORY_UTILIZATION=${GPU_MEMORY_UTILIZATION:-0.3} +GIT_ROOT=$(git rev-parse --show-toplevel) + +# Get the host IP that vLLM will use for KV transfer +# This must match what P2pNcclEngine binds to +KV_HOST=$(python3 -c "from vllm.utils.network_utils import get_ip; print(get_ip())") + +# Trap the SIGINT signal (triggered by Ctrl+C) +trap 'kill $(jobs -pr) 2>/dev/null' SIGINT SIGTERM EXIT + +wait_for_server() { + local port=$1 + timeout 600 bash -c "until curl -s localhost:${port}/v1/completions > /dev/null; do sleep 1; done" +} + +# Cleanup any existing instances +pkill -f "vllm serve" || true +sleep 2 + +# Prefill instance (kv_producer) - port 8100, kv_port 14579 +CUDA_VISIBLE_DEVICES=0 vllm serve $MODEL_NAME \ + --port 8100 \ + --max-model-len 4096 \ + --enforce-eager \ + --gpu-memory-utilization $GPU_MEMORY_UTILIZATION \ + --kv-transfer-config '{"kv_connector":"P2pNcclConnector","kv_role":"kv_producer","kv_port":14579}' & + +# Decode instance (kv_consumer) - port 8200, kv_port 14580 (different!) +CUDA_VISIBLE_DEVICES=1 vllm serve $MODEL_NAME \ + --port 8200 \ + --max-model-len 4096 \ + --enforce-eager \ + --gpu-memory-utilization $GPU_MEMORY_UTILIZATION \ + --kv-transfer-config '{"kv_connector":"P2pNcclConnector","kv_role":"kv_consumer","kv_port":14580}' & + +echo "Waiting for prefill instance on port 8100 to start..." +wait_for_server 8100 +echo "Waiting for decode instance on port 8200 to start..." +wait_for_server 8200 + +# Start proxy server with P2pNccl request ID encoding +# This proxy encodes prefill and decode KV addresses in the request ID +# Note: --kv-host must match the IP that vLLM's P2pNcclEngine binds to +python3 ${GIT_ROOT}/benchmarks/disagg_benchmarks/disagg_prefill_proxy_server.py \ + --port 8192 \ + --prefill-url http://localhost:8100 \ + --decode-url http://localhost:8200 \ + --kv-host ${KV_HOST} \ + --prefill-kv-port 14579 \ + --decode-kv-port 14580 & + +sleep 5 + +# Run accuracy test +TEST_MODEL=$MODEL_NAME python3 -m pytest -s -x ${GIT_ROOT}/tests/v1/kv_connector/pd_integration/test_accuracy.py + +pkill -f "vllm serve" || true +echo "P2pNccl accuracy test completed!" diff --git a/tests/v1/kv_connector/nixl_integration/run_tpu_disagg_accuracy_test.sh b/tests/v1/kv_connector/pd_integration/run_tpu_disagg_accuracy_test.sh similarity index 100% rename from tests/v1/kv_connector/nixl_integration/run_tpu_disagg_accuracy_test.sh rename to tests/v1/kv_connector/pd_integration/run_tpu_disagg_accuracy_test.sh diff --git a/tests/v1/kv_connector/nixl_integration/run_tpu_edge_case_test.sh b/tests/v1/kv_connector/pd_integration/run_tpu_edge_case_test.sh similarity index 100% rename from tests/v1/kv_connector/nixl_integration/run_tpu_edge_case_test.sh rename to tests/v1/kv_connector/pd_integration/run_tpu_edge_case_test.sh diff --git a/tests/v1/kv_connector/nixl_integration/test_accuracy.py b/tests/v1/kv_connector/pd_integration/test_accuracy.py similarity index 100% rename from tests/v1/kv_connector/nixl_integration/test_accuracy.py rename to tests/v1/kv_connector/pd_integration/test_accuracy.py diff --git a/tests/v1/kv_connector/nixl_integration/test_disagg_accuracy.py b/tests/v1/kv_connector/pd_integration/test_disagg_accuracy.py similarity index 100% rename from tests/v1/kv_connector/nixl_integration/test_disagg_accuracy.py rename to tests/v1/kv_connector/pd_integration/test_disagg_accuracy.py diff --git a/tests/v1/kv_connector/nixl_integration/test_edge_cases.py b/tests/v1/kv_connector/pd_integration/test_edge_cases.py similarity index 100% rename from tests/v1/kv_connector/nixl_integration/test_edge_cases.py rename to tests/v1/kv_connector/pd_integration/test_edge_cases.py diff --git a/tests/v1/kv_connector/nixl_integration/toy_proxy_server.py b/tests/v1/kv_connector/pd_integration/toy_proxy_server.py similarity index 100% rename from tests/v1/kv_connector/nixl_integration/toy_proxy_server.py rename to tests/v1/kv_connector/pd_integration/toy_proxy_server.py