Repository navigation
Fix TypeError in histogram generation by casting bin count to int - #32518
Merged
Merged
Conversation
…eration 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.
|
Hi @zhaixuejun1993, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
CISC
reviewed
Nov 18, 2026
CISC
left a comment
Member
There was a problem hiding this comment.
Ah, this is my fault, ironically happened while fixing type errors... :)
Co-authored-by: Sigbjørn Skjæret <[email protected]>
zhaixuejun1993
marked this pull request as ready for review
November 20, 2026 13:21
CISC
approved these changes
Nov 20, 2026
Kidplayer666
pushed a commit
to Kidplayer666/llama.cpp
that referenced
this pull request
Nov 20, 2026
* 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 <[email protected]> --------- Co-authored-by: Sigbjørn Skjæret <[email protected]>
Annieren
pushed a commit
to Annieren/llama.cpp-upstream
that referenced
this pull request
Nov 23, 2026
* 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 <[email protected]> --------- Co-authored-by: Sigbjørn Skjæret <[email protected]>
Nindaleth
pushed a commit
to Nindaleth/llama.cpp
that referenced
this pull request
Nov 26, 2026
* 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 <[email protected]> --------- Co-authored-by: Sigbjørn Skjæret <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes a minor adjustment to how histogram bins are calculated in the
benchmarkfunction ofscripts/server-bench.py. The change ensures that the maximum bin value is explicitly cast to an integer, which may improve compatibility or correctness in plotting.bin_maxin thebenchmarkfunction to cast the result ofnp.ceil(token_t_last)to an integer before adding 1, ensuring the bin range for the histogram is an integer value.…erationSymptom: 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.
Overview
Additional information
Requirements