File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2334,6 +2334,10 @@ void llama_context::output_reorder() {
23342334//
23352335
23362336uint32_t llama_context::graph_max_nodes (uint32_t n_tokens) const {
2337+ if (model.arch == LLM_ARCH_KIMI_K3 ) {
2338+ // the n_tokens*40 budget below is exhausted at ubatch 3840
2339+ return std::max<uint32_t >(n_tokens * 160 , 64u * model.n_tensors ());
2340+ }
23372341 if (model.arch == LLM_ARCH_QWEN3NEXT ||
23382342 model.arch == LLM_ARCH_KIMI_LINEAR ||
23392343 model.arch == LLM_ARCH_QWEN35 ||
Original file line number Diff line number Diff line change @@ -832,6 +832,7 @@ const char * llm_type_name(llm_type type) {
832832 case LLM_TYPE_397B_A17B : return " 397B.A17B" ;
833833 case LLM_TYPE_685B_A37B : return " 685B.A37B" ;
834834 case LLM_TYPE_744B_A40B : return " 744B.A40B" ;
835+ case LLM_TYPE_2_8T_A50B : return " 2.8T.A50B" ;
835836 case LLM_TYPE_E2B : return " E2B" ;
836837 case LLM_TYPE_E4B : return " E4B" ;
837838 default : return " ?B" ;
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ enum llm_type {
142142 LLM_TYPE_397B_A17B , // Qwen3.5
143143 LLM_TYPE_685B_A37B , // DeepSeek V3.2
144144 LLM_TYPE_744B_A40B , // GLM-5
145+ LLM_TYPE_2_8T_A50B , // Kimi-K3
145146 LLM_TYPE_E2B ,
146147 LLM_TYPE_E4B ,
147148};
Original file line number Diff line number Diff line change @@ -47,7 +47,13 @@ void llama_model_kimi_k3::load_arch_hparams(llama_model_loader & ml) {
4747 // K3 always renormalizes the top-k sigmoid weights (moe_renormalize = true)
4848 hparams.expert_weights_norm = true ;
4949
50- type = LLM_TYPE_UNKNOWN ;
50+ GGML_ASSERT (hparams.attn_res_block_size > 0 && " Kimi-K3 requires attn_res_block_size" );
51+ GGML_ASSERT (hparams.moe_latent_size > 0 && " Kimi-K3 requires moe_latent_size" );
52+
53+ switch (hparams.n_layer ()) {
54+ case 93 : type = LLM_TYPE_2_8T_A50B ; break ; // Kimi-K3
55+ default : type = LLM_TYPE_UNKNOWN ;
56+ }
5157}
5258
5359void llama_model_kimi_k3::load_arch_tensors (llama_model_loader &) {
You can’t perform that action at this time.
0 commit comments