@@ -82,6 +82,7 @@ static const std::map<llm_arch, const char *> LLM_ARCH_NAMES = {
8282 { LLM_ARCH_ERNIE4_5, " ernie4_5" },
8383 { LLM_ARCH_HUNYUAN_MOE, " hunyuan-moe" },
8484 { LLM_ARCH_SMOLLM3, " smollm3" },
85+ { LLM_ARCH_LFM2, " lfm2" },
8586 { LLM_ARCH_UNKNOWN, " (unknown)" },
8687};
8788
@@ -188,6 +189,10 @@ static const std::map<llm_kv, const char *> LLM_KV_NAMES = {
188189
189190 { LLM_KV_CLASSIFIER_OUTPUT_LABELS, " %s.classifier.output_labels" },
190191
192+ { LLM_KV_SHORTCONV_L_CACHE, " %s.shortconv.l_cache" },
193+
194+ { LLM_KV_IS_RECURRENT_LAYER, " %s.is_recurrent_layer" },
195+
191196 { LLM_KV_TOKENIZER_MODEL, " tokenizer.ggml.model" },
192197 { LLM_KV_TOKENIZER_PRE, " tokenizer.ggml.pre" },
193198 { LLM_KV_TOKENIZER_LIST, " tokenizer.ggml.tokens" },
@@ -1793,6 +1798,27 @@ static const std::map<llm_arch, std::map<llm_tensor, const char *>> LLM_TENSOR_N
17931798 { LLM_TENSOR_FFN_UP, " blk.%d.ffn_up" },
17941799 },
17951800 },
1801+ {
1802+ LLM_ARCH_LFM2,
1803+ {
1804+ { LLM_TENSOR_ATTN_NORM, " blk.%d.attn_norm" },
1805+ { LLM_TENSOR_ATTN_Q, " blk.%d.attn_q" },
1806+ { LLM_TENSOR_ATTN_K, " blk.%d.attn_k" },
1807+ { LLM_TENSOR_ATTN_V, " blk.%d.attn_v" },
1808+ { LLM_TENSOR_ATTN_OUT, " blk.%d.attn_output" },
1809+ { LLM_TENSOR_ATTN_K_NORM, " blk.%d.attn_k_norm" },
1810+ { LLM_TENSOR_ATTN_Q_NORM, " blk.%d.attn_q_norm" },
1811+ { LLM_TENSOR_FFN_DOWN, " blk.%d.ffn_down" },
1812+ { LLM_TENSOR_FFN_GATE, " blk.%d.ffn_gate" },
1813+ { LLM_TENSOR_FFN_NORM, " blk.%d.ffn_norm" },
1814+ { LLM_TENSOR_FFN_UP, " blk.%d.ffn_up" },
1815+ { LLM_TENSOR_SHORTCONV_CONV, " blk.%d.shortconv.conv" },
1816+ { LLM_TENSOR_SHORTCONV_INPROJ, " blk.%d.shortconv.in_proj" },
1817+ { LLM_TENSOR_SHORTCONV_OUTPROJ, " blk.%d.shortconv.out_proj" },
1818+ { LLM_TENSOR_TOKEN_EMBD, " token_embd" },
1819+ { LLM_TENSOR_TOKEN_EMBD_NORM, " token_embd_norm" },
1820+ }
1821+ },
17961822 {
17971823 LLM_ARCH_UNKNOWN,
17981824 {
@@ -1960,6 +1986,9 @@ static const std::map<llm_tensor, llm_tensor_info> LLM_TENSOR_INFOS = {
19601986 {LLM_TENSOR_CONVNEXT_PW1, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}},
19611987 {LLM_TENSOR_CONVNEXT_PW2, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}},
19621988 {LLM_TENSOR_CONVNEXT_GAMMA, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL}},
1989+ {LLM_TENSOR_SHORTCONV_CONV, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}},
1990+ {LLM_TENSOR_SHORTCONV_INPROJ, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}},
1991+ {LLM_TENSOR_SHORTCONV_OUTPROJ, {LLM_TENSOR_LAYER_REPEATING, GGML_OP_MUL_MAT}},
19631992};
19641993
19651994LLM_KV::LLM_KV (llm_arch arch, const char * suffix) : arch(arch), suffix(suffix) {}
@@ -2031,6 +2060,7 @@ bool llm_arch_is_hybrid(const llm_arch & arch) {
20312060 switch (arch) {
20322061 case LLM_ARCH_JAMBA:
20332062 case LLM_ARCH_FALCON_H1:
2063+ case LLM_ARCH_LFM2:
20342064 return true ;
20352065 default :
20362066 return false ;
0 commit comments