Skip to content

Commit 916e4f5

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 40d293c commit 916e4f5

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
@@ -154,6 +154,7 @@ const char * llm_type_name(llm_type type) {
154154
case LLM_TYPE_1_7B: return "1.7B";
155155
case LLM_TYPE_1_8B: return "1.8B";
156156
case LLM_TYPE_2B: return "2B";
157+
case LLM_TYPE_2_6B: return "2.6B";
157158
case LLM_TYPE_2_8B: return "2.8B";
158159
case LLM_TYPE_2_9B: return "2.9B";
159160
case LLM_TYPE_3B: return "3B";
@@ -2089,10 +2090,11 @@ void llama_model::load_hparams(llama_model_loader & ml) {
20892090
for (uint32_t il = 0; il < hparams.n_layer; ++il) {
20902091
hparams.recurrent_layer_arr[il] = hparams.n_head_kv(il) == 0;
20912092
}
2092-
switch (hparams.n_embd) {
2093-
case 1024: type = LLM_TYPE_350M; break;
2094-
case 1536: type = LLM_TYPE_700M; break;
2095-
case 2048: type = LLM_TYPE_1_2B; break;
2093+
switch (hparams.n_ff()) {
2094+
case 4608: type = LLM_TYPE_350M; break;
2095+
case 6912: type = LLM_TYPE_700M; break;
2096+
case 8192: type = LLM_TYPE_1_2B; break;
2097+
case 10752: type = LLM_TYPE_2_6B; break;
20962098
default: type = LLM_TYPE_UNKNOWN;
20972099
}
20982100
} 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)