Skip to content

Commit e626db7

Browse files
zhaixuejun1993CISC
andauthored
server-bench : fix TypeError in histogram generation (#32518)
* fix(server-bench): prevent float bin-count TypeError in histogram generation Symptom: benchmark crashes while generating gen_rate histogram. Root cause: np.ceil(...) returns numpy.float64, and that value was used where an integer count/shape argument is required. Fix: cast ceil result to int before +1, ensuring bin count is an integer. Result: histogram path completes and gen_rate.png is generated reliably. * Update scripts/server-bench.py Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co> --------- Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
1 parent c6a25fc commit e626db7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎scripts/server-bench.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def benchmark(
264264

265265
bin_max = np.ceil(token_t_last) + 1
266266
plt.figure()
267-
plt.hist(token_t, np.linspace(0, bin_max, bin_max, endpoint=False).tolist())
267+
plt.hist(token_t, np.linspace(0, bin_max, int(bin_max), endpoint=False).tolist())
268268
plt.xlim(0, bin_max + 1)
269269
plt.title(name or "")
270270
plt.xlabel("Time [s]")

0 commit comments

Comments
 (0)
⌂ 换网址