mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-15 21:28:33 -05:00
[PR #1936] [MERGED] fix(mlperf-edu): p99 decode-latency formula wrong for small sample counts #32200
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/1936
Author: @Shashank-Tripathi-07
Created: 7/7/2026
Status: ✅ Merged
Merged: 7/10/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/nanogpt-decode-p99-percentile📝 Commits (1)
a1be485fix(mlperf-edu): p99 decode-latency formula wrong for small sample counts📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
mlperf-edu/reference/cloud/nanogpt_decode.py(+2 -1)📄 Description
Summary
sorted(per_step)[int(len(per_step) * 0.99) - 1]picks the wrong index for smalln. For the min/smoke profile's default of 4 decode steps (n_loop=3),int(3*0.99)-1 = 1, i.e. the ~66th percentile (the middle value), not p99 (which for 3 samples should be the max).mlperf/harness.py's ownpercentile()already implements this correctly with a ceil-based rank (rank = max(1, ceil(p/100*n))), matching the same pattern already used elsewhere inreference/cloud/(e.g.from mlperf.roofline import measure_roofline). Reused it instead of duplicating the broken formula.Test plan
per_step=[10.0, 20.0, 30.0]: returned20.0(the median), not p99.harness.percentile([10.0, 20.0, 30.0], 99)returns30.0(the correct max/p99 for 3 samples).python -m py_compilepasses on the edited file.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.