|
26 | 26 | load_aggregate, |
27 | 27 | load_records, |
28 | 28 | ) |
| 29 | +from utils.agentic.aggregation.process_agentic_result import _gpu_shape |
29 | 30 | from utils.agentic.aggregation.server_metrics import ( |
30 | 31 | compute_server_metrics, |
31 | 32 | load_server_metrics, |
@@ -308,6 +309,8 @@ def _run_processor( |
308 | 309 | env_overrides: dict[str, str] | None = None, |
309 | 310 | ) -> dict: |
310 | 311 | env = os.environ.copy() |
| 312 | + env.pop("PREFILL_HARDWARE", None) |
| 313 | + env.pop("DECODE_HARDWARE", None) |
311 | 314 | env.update( |
312 | 315 | { |
313 | 316 | "RESULT_DIR": str(result_dir), |
@@ -453,6 +456,70 @@ def test_processor_surfaces_allocated_cpu_dram(tmp_path: Path): |
453 | 456 | assert agg["allocated_cpu_dram_gb"] == 2400 |
454 | 457 |
|
455 | 458 |
|
| 459 | +def test_multinode_processor_surfaces_heterogeneous_hardware(tmp_path: Path): |
| 460 | + result_dir = _write_fixture(tmp_path) |
| 461 | + agg = _run_processor( |
| 462 | + result_dir, |
| 463 | + tmp_path / "out", |
| 464 | + env_overrides={ |
| 465 | + "IS_MULTINODE": "true", |
| 466 | + "DISAGG": "true", |
| 467 | + "PREFILL_NUM_WORKERS": "1", |
| 468 | + "PREFILL_TP": "8", |
| 469 | + "PREFILL_EP": "8", |
| 470 | + "PREFILL_DP_ATTN": "false", |
| 471 | + "PREFILL_HARDWARE": "b200", |
| 472 | + "DECODE_NUM_WORKERS": "2", |
| 473 | + "DECODE_TP": "8", |
| 474 | + "DECODE_EP": "8", |
| 475 | + "DECODE_DP_ATTN": "false", |
| 476 | + "DECODE_HARDWARE": "h100", |
| 477 | + }, |
| 478 | + ) |
| 479 | + |
| 480 | + assert agg["prefill_hw"] == "b200" |
| 481 | + assert agg["decode_hw"] == "h100" |
| 482 | + |
| 483 | + |
| 484 | +def test_multinode_processor_omits_homogeneous_hardware(tmp_path: Path): |
| 485 | + result_dir = _write_fixture(tmp_path) |
| 486 | + agg = _run_processor( |
| 487 | + result_dir, |
| 488 | + tmp_path / "out", |
| 489 | + env_overrides={ |
| 490 | + "IS_MULTINODE": "true", |
| 491 | + "DISAGG": "true", |
| 492 | + "PREFILL_NUM_WORKERS": "1", |
| 493 | + "PREFILL_TP": "8", |
| 494 | + "DECODE_NUM_WORKERS": "2", |
| 495 | + "DECODE_TP": "8", |
| 496 | + }, |
| 497 | + ) |
| 498 | + |
| 499 | + assert "prefill_hw" not in agg |
| 500 | + assert "decode_hw" not in agg |
| 501 | + |
| 502 | + |
| 503 | +@pytest.mark.parametrize( |
| 504 | + ("present_var", "missing_var"), |
| 505 | + [ |
| 506 | + ("PREFILL_HARDWARE", "DECODE_HARDWARE"), |
| 507 | + ("DECODE_HARDWARE", "PREFILL_HARDWARE"), |
| 508 | + ], |
| 509 | +) |
| 510 | +def test_multinode_processor_rejects_one_sided_hardware( |
| 511 | + monkeypatch: pytest.MonkeyPatch, |
| 512 | + present_var: str, |
| 513 | + missing_var: str, |
| 514 | +): |
| 515 | + monkeypatch.setenv("IS_MULTINODE", "true") |
| 516 | + monkeypatch.setenv(present_var, "b200") |
| 517 | + monkeypatch.delenv(missing_var, raising=False) |
| 518 | + |
| 519 | + with pytest.raises(SystemExit, match="must be specified together"): |
| 520 | + _gpu_shape() |
| 521 | + |
| 522 | + |
456 | 523 | def test_processor_surfaces_request_accounting(tmp_path: Path): |
457 | 524 | result_dir = tmp_path / "results" |
458 | 525 | artifact = result_dir / "aiperf_artifacts" |
|
0 commit comments