Skip to content

Commit ad8c587

Browse files
tdakhranCISC
authored andcommitted
model : add label for LiquidAI LFM2-2.6B model (ggml-org#16204)
* model : add label for LiquidAI LFM2-2.6B model HF link: [LiquidAI/LFM2-2.6B](https://huggingface.co/LiquidAI/LFM2-2.6B). Support for GGUF conversion and inference is added in ggml-org#14620. However, due to similar `n_embd`, it identifies as a 1.2B model. Fix the label by using `n_ff` to identify the model instead. Output of `llama-bench`: ``` | model | size | params | backend | threads | test | t/s | | ------------------------------ | ---------: | ---------: | ---------- | ------: | --------------: | -------------------: | | lfm2 1.2B F16 | 2.18 GiB | 1.17 B | CPU | 10 | pp512 | 223.97 ± 5.32 | | lfm2 2.6B F16 | 4.79 GiB | 2.57 B | CPU | 10 | pp512 | 92.53 ± 4.14 | | lfm2 350M F16 | 676.25 MiB | 354.48 M | CPU | 10 | pp512 | 725.52 ± 11.70 | | lfm2 700M F16 | 1.38 GiB | 742.49 M | CPU | 10 | pp512 | 336.22 ± 12.93 | ``` * Update src/llama-model.cpp Co-authored-by: Sigbjørn Skjæret <[email protected]> --------- Co-authored-by: Sigbjørn Skjæret <[email protected]>
1 parent ca6c6b3 commit ad8c587

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/llama-model.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const char * llm_type_name(llm_type type) {
6666
case LLM_TYPE_1_7B: return "1.7B";
6767
case LLM_TYPE_1_8B: return "1.8B";
6868
case LLM_TYPE_2B: return "2B";
69+
case LLM_TYPE_2_6B: return "2.6B";
6970
case LLM_TYPE_2_8B: return "2.8B";
7071
case LLM_TYPE_2_9B: return "2.9B";
7172
case LLM_TYPE_3B: return "3B";
@@ -1977,10 +1978,11 @@ void llama_model::load_hparams(llama_model_loader & ml) {
19771978
for (uint32_t il = 0; il < hparams.n_layer; ++il) {
19781979
hparams.recurrent_layer_arr[il] = hparams.n_head_kv(il) == 0;
19791980
}
1980-
switch (hparams.n_embd) {
1981-
case 1024: type = LLM_TYPE_350M; break;
1982-
case 1536: type = LLM_TYPE_700M; break;
1983-
case 2048: type = LLM_TYPE_1_2B; break;
1981+
switch (hparams.n_ff()) {
1982+
case 4608: type = LLM_TYPE_350M; break;
1983+
case 6912: type = LLM_TYPE_700M; break;
1984+
case 8192: type = LLM_TYPE_1_2B; break;
1985+
case 10752: type = LLM_TYPE_2_6B; break;
19841986
default: type = LLM_TYPE_UNKNOWN;
19851987
}
19861988
} break;

src/llama-model.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ enum llm_type {
5858
LLM_TYPE_1_7B,
5959
LLM_TYPE_1_8B,
6060
LLM_TYPE_2B,
61+
LLM_TYPE_2_6B,
6162
LLM_TYPE_2_8B,
6263
LLM_TYPE_2_9B,
6364
LLM_TYPE_3B,

0 commit comments

Comments
 (0)