-
Notifications
You must be signed in to change notification settings - Fork 11.7k
llama-bench : accept ranges for integer parameters #13410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
for (const auto & t : p) { | ||
ggml_type gt = ggml_type_from_name(t); | ||
if (gt == GGML_TYPE_COUNT) { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only real change here is replacing string_split<int>(argv[i], split_delim)
with parse_int_range(argv[i])
, the rest of the diff is due to the change in indentation.
tools/llama-bench/llama-bench.cpp
Outdated
@@ -323,7 +347,7 @@ static void print_usage(int /* argc */, char ** argv) { | |||
printf("\n"); | |||
printf( | |||
"Multiple values can be given for each parameter by separating them with ',' or by specifying the parameter " | |||
"multiple times.\n"); | |||
"multiple times. Ranges can be specified with 'start-end' or 'start-end+step'.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should specify that the ranges are inclusive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to first-last+step
. Is that clear enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that also works but I think it would make sense to also rename the variables in the code to match the help.
Would it be possible to support not just linear step sizes but exponential ones as well? So something like |
Accept ranges with the syntax
start-end[+step]
for all integer parameters.Example: