Analyze Qwen235 fixed PD simulator state

This commit is contained in:
2026-07-19 18:37:18 +08:00
parent 5927b6bfc3
commit b6dfbfcad7
2 changed files with 478 additions and 0 deletions

View File

@@ -187,6 +187,42 @@ class FidelityEnvelopeTest(unittest.TestCase):
base, metrics_root=Path("/new/metrics"), run_id="state-run"
)
def test_qwen235_real_state_proxy_parser(self) -> None:
module = load("analyze_qwen235_fixed_pd_state.py")
line = (
"Engine 000: Avg prompt throughput: 3276.8 tokens/s, "
"Avg generation throughput: 204.8 tokens/s, Running: 5 reqs, "
"Waiting: 0 reqs, GPU KV cache usage: 5.6%, Prefix cache hit rate: 0.0%\n"
)
with tempfile.TemporaryDirectory() as temporary:
path = Path(temporary) / "server.log"
path.write_text(line)
self.assertEqual(
module.parse_real_log(path),
[
{
"prompt_tokens_per_s": 3276.8,
"generation_tokens_per_s": 204.8,
"running": 5,
"waiting": 0,
"kv_percent": 5.6,
}
],
)
def test_qwen235_component_categories_are_additive(self) -> None:
module = load("analyze_qwen235_fixed_pd_state.py")
components = {
name: 1.0
for names in module.CATEGORIES.values()
for name in names
}
categorized = module.categorized_components(components)
self.assertEqual(sum(categorized.values()), float(len(components)))
components["unknown_graph_overhead"] = 1.0
with self.assertRaisesRegex(ValueError, "component schema drift"):
module.categorized_components(components)
def test_materialize_qwen235_allreduce_requires_serving_contract(self) -> None:
module = load("materialize_qwen235_v020_allreduce.py")
with tempfile.TemporaryDirectory() as temporary: