nemotron-h: distinguish Nemotron 3 Puzzle (75B.A9B) from Super (120B.A12B)

Both have 88 layers; the per-layer expert_used_count array (heterogeneous
for Puzzle, broadcast-uniform for Super) is the discriminator.
This commit is contained in:
Yaniss
2026-07-26 11:30:37 +02:00
parent 0515548f55
commit f824e09dc8
3 changed files with 13 additions and 1 deletions
+1
View File
@@ -810,6 +810,7 @@ const char * llm_type_name(llm_type type) {
case LLM_TYPE_31B_A3_5B: return "31B.A3.5B";
case LLM_TYPE_35B_A3B: return "35B.A3B";
case LLM_TYPE_48B_A3B: return "48B.A3B";
case LLM_TYPE_75B_A9B: return "75B.A9B";
case LLM_TYPE_80B_A3B: return "80B.A3B";
case LLM_TYPE_100B_A6B: return "100B.A6B";
case LLM_TYPE_102B_A12B: return "102B.A12B";
+1
View File
@@ -126,6 +126,7 @@ enum llm_type {
LLM_TYPE_31B_A3_5B,
LLM_TYPE_35B_A3B, // Qwen3.5
LLM_TYPE_48B_A3B, // Kimi Linear
LLM_TYPE_75B_A9B, // Nemotron 3 Puzzle
LLM_TYPE_80B_A3B, // Qwen3 Next
LLM_TYPE_100B_A6B,
LLM_TYPE_102B_A12B, // Solar-Open
+11 -1
View File
@@ -42,7 +42,17 @@ void llama_model_nemotron_h::load_arch_hparams(llama_model_loader & ml) {
switch (hparams.n_layer()) {
case 52: type = LLM_TYPE_31B_A3_5B; break; // Nemotron-H_MOE 31B
case 56: type = LLM_TYPE_9B; break;
case 88: type = LLM_TYPE_120B_A12B; break;
case 88:
{
// Nemotron 3 Super (uniform MoE) and Nemotron 3 Puzzle (per-layer
// heterogeneous MoE) both have 88 layers; the per-layer top-k array
// is the discriminator.
bool heterogeneous = false;
for (uint32_t i = 1; i < hparams.n_layer(); ++i) {
heterogeneous |= hparams.n_expert_used_arr[i] != hparams.n_expert_used_arr[0];
}
type = heterogeneous ? LLM_TYPE_75B_A9B : LLM_TYPE_120B_A12B;
} break;
default: type = LLM_TYPE_UNKNOWN;
}
}