Skip to content
Open
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
4 changes: 4 additions & 0 deletions components/src/dynamo/aisimulate/tests/dgd/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ checks emitted manifests and `index.json` against the selected Candidates in
runtime image, namespace, runtime override, and total GPU use. The Pareto checks
reject rendering the same Candidate repeatedly under different names.

The aggregated case omits the runtime block size, and the router case explicitly
sets it to `null`; both must omit `--block-size` from the generated worker args.
The other cases retain explicit block sizes.

The fixed aggregated and disaggregated cases also compare the complete DGD to
`goldens/`. Run the table from the repository root:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ engine:
preset:
- {replicas: 1, tensor: 1, pipeline: 1, attention_data: 1, moe_tensor: 1, moe_expert: 1}
scheduler: {max_batched_tokens: 8192, max_sequences: 4}
kv_cache: {block_size: 64, prefix_caching: true, capacity: {type: fixed, blocks: 256}}
kv_cache: {prefix_caching: true, capacity: {type: fixed, blocks: 256}}
timing: {type: fixed, prefill_ms: 1, decode_ms: 1}
optimization:
target: throughput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ engine:
parallelism:
preset:
- {replicas: 1, tensor: 1, pipeline: 1, attention_data: 1, moe_tensor: 1, moe_expert: 1}
scheduler: {max_batched_tokens: 32, max_sequences: {choices: [1, 4]}}
scheduler: {max_batched_tokens: 64, max_sequences: {choices: [1, 4]}}
kv_cache: {block_size: 64, prefix_caching: true, capacity: {type: fixed, blocks: 256}}
timing: {type: fixed, prefill_ms: 1, decode_ms: 1}
optimization:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ engine:
preset:
- {replicas: 2, tensor: 1, pipeline: 1, attention_data: 1, moe_tensor: 1, moe_expert: 1}
scheduler: {max_batched_tokens: 8192, max_sequences: 256}
kv_cache: {block_size: 64, prefix_caching: true, capacity: {type: fixed, blocks: 256}}
kv_cache: {block_size: null, prefix_caching: true, capacity: {type: fixed, blocks: 256}}
timing: {type: fixed, prefill_ms: 1, decode_ms: 1}
router:
policy: {choices: [round_robin, kv_router]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ spec:
- '1'
- --data-parallel-size
- '1'
- --block-size
- '64'
- --num-gpu-blocks-override
- '256'
- --max-num-seqs
Expand Down
21 changes: 16 additions & 5 deletions components/src/dynamo/aisimulate/tests/dgd/e2e/test_dgd_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def _assert_dgd_golden(golden: Path, manifests: list[dict[str, Any]]) -> None:


def _assert_dgd_outputs(
config_path: Path, options: dict[str, Any], output: Path
config_path: Path, input_config: dict[str, Any], output: Path
) -> None:
options = input_config["dgd"]
result = SweepResult.model_validate_json(
(output / "recommendation.json").read_text()
)
Expand Down Expand Up @@ -183,6 +184,13 @@ def _assert_dgd_outputs(
role = roles[component["type"]]
prefix = "" if role == "agg" else f"{role}_"
assert component["replicas"] == config[f"{prefix}replicas"]

# Preserve the requested block size through Candidate creation and rendering.
worker_config = input_config["engine"]["workers"][
"aggregated" if role == "agg" else role
]
block_size = worker_config["kv_cache"].get("block_size")
assert config.get(f"{role}_block_size") == block_size
args = container["args"]
for flag, expected in {
"--model": config["model_name"],
Expand All @@ -192,11 +200,14 @@ def _assert_dgd_outputs(
"--max-model-len": config["context_length"],
"--max-num-seqs": config[f"{role}_max_num_seqs"],
"--max-num-batched-tokens": config[f"{role}_max_num_batched_tokens"],
"--block-size": config[f"{role}_block_size"],
"--block-size": block_size,
"--num-gpu-blocks-override": config[f"{role}_num_gpu_blocks"],
}.items():
assert args.count(flag) == 1
assert args[args.index(flag) + 1] == str(expected)
if expected is None:
assert flag not in args
else:
assert args.count(flag) == 1
assert args[args.index(flag) + 1] == str(expected)
assert ("--no-enable-prefix-caching" in args) != config[
f"{role}_enable_prefix_caching"
]
Expand Down Expand Up @@ -249,4 +260,4 @@ def test_dgd_cli_cases(config_path: Path, tmp_path: Path) -> None:
)
assert json.loads(result.stdout)
assert "router AIC payload requires" not in result.stderr
_assert_dgd_outputs(config_path, config["dgd"], output)
_assert_dgd_outputs(config_path, config, output)
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

import pytest
import yaml
from aisimulate.generator.request.schema import ModelFacts
from aisimulate.sweeper.config import Workload

from dynamo.aisimulate.output.dgd.renderers import (
CandidateMaterializationError,
Expand All @@ -24,7 +22,6 @@
from dynamo.aisimulate.output.dgd.renderers import render_dgd
from dynamo.aisimulate.output.dgd.renderers.aic import renderer as aic_renderer
from dynamo.frontend.frontend_args import FrontendArgGroup, FrontendConfig
from dynamo.profiler.utils.config_modifiers import vllm

pytestmark = [
pytest.mark.unit,
Expand Down Expand Up @@ -161,6 +158,12 @@ def _without_transfer_buffer_size(rendered: str) -> dict:
def test_installed_aic_renders_trace_workloads_like_synthetic_ones(
monkeypatch, tmp_path, backend, backend_version, image
) -> None:
pytest.importorskip("aisimulate.generator")
from aisimulate.generator.request.schema import ModelFacts
from aisimulate.sweeper.config import Workload

from dynamo.profiler.utils.config_modifiers import vllm

# Keep the renders offline: model facts come from the request below.
monkeypatch.setattr(vllm, "get_model_context_length", lambda _model: None)
monkeypatch.setattr(vllm, "get_mamba_cache_align_block_size", lambda _model: None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ spec:
mode: aggregated
context_length: 32768
workers:
# TODO(#17581): Remove this explicit value after AISimulate preserves an unset runtime block size.
aggregated:
kv_cache:
block_size: 64
prefill: null
decode: null
traffic:
Expand Down
Loading