"deploy/vscode:/vscode.git/clone" did not exist on "dba51eed823af5a0e864d0b4fb2c42ea9ea52dc2"
Unverified Commit ab5a31b5 authored by Alec's avatar Alec Committed by GitHub
Browse files

test(planner): isolate planner-family suites [DYN-2534] (#7723)

parent cc22114d
......@@ -59,9 +59,6 @@ dynamo/
│ ├── deploy/ # Deployment tests
│ ├── frontend/ # Frontend HTTP/gRPC tests
│ ├── router/ # Router E2E tests
│ ├── planner/ # Planner tests (unit + E2E)
│ ├── profiler/ # Profiler tests
│ ├── global_planner/ # Global planner unit tests
│ ├── mm_router/ # Multimodal router tests
│ ├── lmcache/ # LM cache tests
│ ├── basic/ # Basic backend tests
......@@ -93,9 +90,10 @@ dynamo/
| End-to-End | User workflows, CLI, API | `tests/serve/`, `tests/deploy/`, etc. |
| KVBM Integration | KV block manager integration | `tests/kvbm_integration/` |
| Router | Router E2E with backends | `tests/router/` |
| Planner | Planner unit + scaling tests | `tests/planner/` |
| Planner | Planner unit + integration tests | `components/src/dynamo/planner/tests/` |
| Frontend | Frontend HTTP/gRPC tests | `tests/frontend/` |
| Profiler | Profiler tests | `tests/profiler/` |
| Profiler | Profiler unit + integration tests | `components/src/dynamo/profiler/tests/` |
| Global Planner | Global planner unit tests | `components/src/dynamo/global_planner/tests/`|
| Fault Tolerance | Chaos, migration, cancellation | `tests/fault_tolerance/` |
| Deployment | Deployment validation | `tests/deploy/` |
| Benchmark | Performance/load | `benchmarks/` |
......
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import asyncio
import sys
from typing import Literal
import pytest
from dynamo.planner import LocalConnector
from dynamo.runtime import DistributedRuntime, dynamo_worker
pytestmark = pytest.mark.skip("This is not a test file")
ComponentType = Literal["VllmWorker", "PrefillWorker"]
VALID_COMPONENTS = ["VllmWorker", "PrefillWorker"]
async def test_state_management(connector: LocalConnector) -> bool:
"""Test state file operations."""
print("\n=== Testing State Management ===")
try:
# Test load state
state = await connector._load_state()
print("✓ Load state successful")
# Test save state (with a copy)
success = await connector._save_state(state)
print(
f"{'✓' if success else '✗'} Save state {'successful' if success else 'failed'}"
)
return True
except Exception as e:
print(f"✗ State management test failed: {e}")
return False
async def test_add_component(
connector: LocalConnector, component: ComponentType
) -> bool:
"""Test adding a component."""
print(f"\n=== Testing Add Component: {component} ===")
try:
success = await connector.add_component(component)
print(
f"{'✓' if success else '✗'} Add {component} {'successful' if success else 'failed'}"
)
return success
except Exception as e:
print(f"✗ Add {component} test failed: {e}")
return False
async def test_remove_component(
connector: LocalConnector, component: ComponentType
) -> bool:
"""Test removing a component."""
print(f"\n=== Testing Remove Component: {component} ===")
try:
state = await connector._load_state()
base_name = f"{connector.namespace}_{component}_"
# Find all components with numbered suffixes
matching_components = []
for watcher_name in state["components"].keys():
if watcher_name.startswith(base_name):
try:
suffix = int(watcher_name.replace(base_name, ""))
matching_components.append((suffix, watcher_name))
except ValueError:
continue
if not matching_components:
base_component = f"{connector.namespace}_{component}"
if base_component in state["components"]:
success = await connector.remove_component(component)
print(
f"{'✓' if success else '✗'} Remove {component} {'successful' if success else 'failed'}"
)
return success
else:
print(f"✗ No {component} components found to remove")
return False
# Remember which watcher we're removing
highest_suffix = max(suffix for suffix, _ in matching_components)
target_component = f"{base_name}{highest_suffix}"
success = await connector.remove_component(component)
# New verification logic that handles both numbered and base watchers
if success:
new_state = await connector._load_state()
# For numbered watchers (with suffix > 0)
if highest_suffix > 0:
# Success if the component is completely removed
if target_component not in new_state["components"]:
print(f"✓ Successfully removed {target_component}")
return True
else:
print(f"✗ Failed to remove {target_component} from state")
return False
# For base watchers (no suffix)
else:
base_component = f"{connector.namespace}_{component}"
if base_component in new_state["components"]:
resources = new_state["components"][base_component].get(
"resources", {}
)
if not resources.get("allocated_gpus"):
print(f"✓ Successfully cleared resources for {base_component}")
return True
else:
print(f"✗ Failed to clear resources for {base_component}")
return False
# If we get here, neither condition was met
print(f"✗ Unexpected state after removing {component}")
return False
print(f"✗ Failed to remove {component}")
return False
except Exception as e:
print(f"✗ Remove {component} test failed: {e}")
return False
@dynamo_worker()
async def main(runtime: DistributedRuntime):
connector = LocalConnector("dynamo", runtime)
await connector.add_component("PrefillWorker")
await connector.add_component("VllmWorker")
await connector.remove_component("VllmWorker")
await connector.remove_component("PrefillWorker")
if __name__ == "__main__":
sys.exit(asyncio.run(main()))
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
# This is a simple load test script for the planner component. To validate
# 1. Run 1P1D (default disagg router setup)
# 2. Start planner with python components/planner.py --namespace dynamo --decode-kv-scale-up-threshold 0.2 --decode-kv-scale-down-threshold 0.1 --adjustment-interval 10
# 3. Run ./load_test.sh 100
# Expected behavior is scale up to 1P2D and then back down to 1P1D
# Check if the number of executions is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <number_of_executions>"
exit 1
fi
# Store the number of executions
executions=$1
echo "Starting $executions non-blocking executions..."
# Launch the command x times in the background
for (( i=1; i<=$executions; i++ )); do
# isl around 2000
curl localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "deepseek-ai/DeepSeek-R1-Distill-Llama-8B",
"messages": [
{
"role": "user",
"content": "In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden. In the heart of Eldoria, an ancient land of boundless magic and mysterious creatures, lies the long-forgotten city of Aeloria. Once a beacon of knowledge and power, Aeloria was buried beneath the shifting sands of time, lost to the world for centuries. You are an intrepid explorer, known for your unparalleled curiosity and courage, who has stumbled upon an ancient map hinting at ests that Aeloria holds a secret so profound that it has the potential to reshape the very fabric of reality. Your journey will take you through treacherous deserts, enchanted forests, and across perilous mountain ranges. Your Task: Character Background: Develop a detailed background for your character. Describe their motivations for seeking out Aeloria, their skills and weaknesses, and any personal connections to the ancient city or its legends. Are they driven by a quest for knowledge, a search for lost familt clue is hidden."
}
],
"stream": true,
"max_tokens": 500
}' > /dev/null 2>&1 &
done
echo "All $executions executions have been launched!"
\ No newline at end of file
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for the profiler module."""
......@@ -61,7 +61,8 @@ BASE_PORT_ZMQ = 11100 # Base port for ZMQ KV event publishing
NUM_REQUESTS = 100
BLOCK_SIZE = 16
PLANNER_PROFILE_DATA_DIR = (
Path(__file__).resolve().parents[1] / "planner/profiling_results/H200_TP1P_TP1D"
Path(__file__).resolve().parents[2]
/ "components/src/dynamo/planner/tests/data/profiling_results/H200_TP1P_TP1D"
)
......@@ -652,7 +653,7 @@ class DisaggMockerProcess:
self._bootstrap_ports = []
@pytest.mark.timeout(120) # bumped for xdist contention (was 42s; ~13.80s serial avg)
@pytest.mark.timeout(180) # planner-profile mocker setup can exceed 120s on CI CPUs
@pytest.mark.parametrize(
"router_mode,durable_kv_events,mocker_args_override",
[
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment