Spaces:
Running
Running
Download tests/test_consolidation.py from ArchitSharma/InferScale-Sim: direct link, hf CLI and curl.
- Browser
- Download file 859 Bytes
-
https://huggingface.co/spaces/ArchitSharma/InferScale-Sim/resolve/main/tests/test_consolidation.py
- Command line
-
hf download hf://spaces/ArchitSharma/InferScale-Sim/tests/test_consolidation.py
-
curl -L -o test_consolidation.py https://huggingface.co/spaces/ArchitSharma/InferScale-Sim/resolve/main/tests/test_consolidation.py
859 Bytes
| from inferscale.consolidation import repeated_seed_policy_study | |
| def test_repeated_seed_study_reports_uncertainty_pareto_and_regret(): | |
| result = repeated_seed_policy_study( | |
| { | |
| "model": "Qwen2.5-3B", | |
| "accelerator": "L4", | |
| "quantization": "int8", | |
| "seed": 5, | |
| "duration_s": 35, | |
| "workflow_rate_rps": 0.12, | |
| "max_steps": 5, | |
| }, | |
| repetitions=4, | |
| bootstrap_samples=120, | |
| ) | |
| assert result["repetitions"] == 4 | |
| assert len(result["policies"]) == 4 | |
| assert result["oracle"]["candidate_count_per_seed"] >= 15 | |
| assert result["robust_winner"] | |
| for row in result["policies"]: | |
| assert 0 <= row["pareto_stability"] <= 1 | |
| assert row["median_oracle_regret_ms"] >= 0 | |
| assert row["ttft_ci95_low_ms"] <= row["ttft_ci95_high_ms"] | |