测试

这里的测试不是为了覆盖所有边角,而是为了把文档里的关键公式钉在可执行样例上。你可以把它理解成“公式是否真的在代码里成立”的最小回归集。

重点测试

常用运行方式

python -m pytest tests -v
python -m pytest tests/test_kv_cache.py tests/test_kv_compression.py -v
python -m pytest tests/test_serving_metrics.py tests/test_queueing_slo.py -v
python -m pytest tests/test_moe_routing.py -v

建议的对照顺序

  1. 先读 ../notes/kv-compression/formula-to-code-walkthrough.md,再跑 test_kv_compression.py

  2. 先读 ../notes/kv-eviction/formula-to-code-walkthrough.md,再跑 test_kv_cache.py

  3. 先读 ../notes/serving/formula-to-code-walkthrough.md../notes/serving/queueing-slo-formula-to-code-walkthrough.md,再跑 test_serving_metrics.pytest_queueing_slo.pytest_scheduler.py

  4. 先读 ../notes/distributed/moe-formula-to-code-walkthrough.md,再跑 test_moe_routing.py

最后更新于