mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-07 18:18:42 -05:00
[PR #1597] [MERGED] fix(mlsysim): correct unit conversion in calc_monthly_egress_cost #9209
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1597
Author: @Shashank-Tripathi-07
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/29/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/egress-cost-unit-bug📝 Commits (1)
4e1301ffix(mlsysim): correct unit conversion in calc_monthly_egress_cost📊 Changes
2 files changed (+86 additions, -1 deletions)
View changed files
📝
mlsysim/mlsysim/core/formulas.py(+2 -1)📝
mlsysim/tests/test_formulas.py(+84 -0)📄 Description
Summary
calc_monthly_egress_costmultipliedmonthly_bytes(in bytes) by the rawcost_per_gbnumber without any unit conversion_ensure_unitto attachdollar/gigabytetocost_per_gb, then convert todollar/bytebefore multiplyingRoot cause
Tests added
TestMonthlyEgressCost-- 4 tests: known-answer (raw + Quantity), zero bandwidth, linear scalingTestFleetTCO-- 3 tests: known-answer, zero quantity, linear scalingTestMTBFNode-- 3 tests: single component, two GPUs halves MTBF, mixed componentsAll three functions previously had zero test coverage in
test_formulas.py.Test plan
pytest mlsysim/tests/test_formulas.py -vpasses (54 tests, was 43)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.