Skip to content

Commit fd43d66

Browse files
authored
server : add KV cache quantization options (#5684)
1 parent 54fbcd2 commit fd43d66

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

examples/server/server.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -1948,6 +1948,10 @@ static void server_print_usage(const char *argv0, const gpt_params &params,
19481948
printf(" -cb, --cont-batching enable continuous batching (a.k.a dynamic batching) (default: disabled)\n");
19491949
printf(" -spf FNAME, --system-prompt-file FNAME\n");
19501950
printf(" set a file to load a system prompt (initial prompt of all slots), this is useful for chat applications.\n");
1951+
printf(" -ctk TYPE, --cache-type-k TYPE\n");
1952+
printf(" KV cache data type for K (default: f16)\n");
1953+
printf(" -ctv TYPE, --cache-type-v TYPE\n");
1954+
printf(" KV cache data type for V (default: f16)\n");
19511955
printf(" --mmproj MMPROJ_FILE path to a multimodal projector file for LLaVA.\n");
19521956
printf(" --log-disable disables logging to a file.\n");
19531957
printf(" --slots-endpoint-disable disables slots monitoring endpoint.\n");
@@ -2386,6 +2390,12 @@ static void server_params_parse(int argc, char **argv, server_params &sparams,
23862390
);
23872391
llama.process_system_prompt_data(json::parse(systm_content));
23882392
}
2393+
else if (arg == "-ctk" || arg == "--cache-type-k") {
2394+
params.cache_type_k = argv[++i];
2395+
}
2396+
else if (arg == "-ctv" || arg == "--cache-type-v") {
2397+
params.cache_type_v = argv[++i];
2398+
}
23892399
else if(arg == "--mmproj")
23902400
{
23912401
if (++i >= argc)

0 commit comments

Comments
 (0)