mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-16 23:24:55 -05:00
`sorted(per_step)[int(len(per_step) * 0.99) - 1]` picks the wrong index for small n. 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 should be the max of 3 samples). harness.py's own percentile() already implements this correctly with a ceil-based rank, so reuse it instead of duplicating a broken formula. Verified: for per_step=[10.0, 20.0, 30.0], the old formula returned 20.0 (the median); the correct p99 is 30.0 (the max).