feat: first draft of f32 sparsity support

This commit is contained in:
DandinPower
2025-10-06 10:00:50 +08:00
parent d63cdf13b5
commit 45a78f2623
8 changed files with 244 additions and 13 deletions
+8 -1
View File
@@ -2120,11 +2120,18 @@ gpt_params_context gpt_params_parser_init(gpt_params & params, llama_example ex,
));
add_opt(llama_arg(
{"--comm-datatype"}, "TYPE",
format("Datatype for communication, currently support f32, q8_0, q4_0 (default: %s)", params.comm_datatype.c_str()),
format("Datatype for communication, currently support f32, q8_0, q4_0 or f32_sparsity (default: %s)", params.comm_datatype.c_str()),
[](gpt_params & params, const std::string & value) {
params.comm_datatype = value;
}
));
add_opt(llama_arg(
{"--comm-sparse-percentage"}, "N",
format("Sparse percentage for communication. Currently supported only when the communication data type is f32_sparsity (default: %d). The input value must range from 1 to 100.", params.comm_sparse_percentage),
[](gpt_params &params, int value) {
params.comm_sparse_percentage = value;
}
));
add_opt(llama_arg(
{"--positive-file"}, "FNAME",
format("positive prompts file, one prompt per line (default: '%s')", params.cvector_positive_file.c_str()),