Skip to content

Commit 9eaed2e

Browse files
yt0428jeejeelee
authored andcommitted
[model] Add support for openPangu_Ultra_MoE (vllm-project#27521)
Signed-off-by: yuantao <[email protected]> Signed-off-by: yt0428 <[email protected]> Co-authored-by: Jee Jee Li <[email protected]>
1 parent b3bc1f8 commit 9eaed2e

File tree

8 files changed

+1379
-1
lines changed

8 files changed

+1379
-1
lines changed

docs/models/supported_models.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ th {
404404
| `OPTForCausalLM` | OPT, OPT-IML | `facebook/opt-66b`, `facebook/opt-iml-max-30b`, etc. | ✅︎ | ✅︎ |
405405
| `OrionForCausalLM` | Orion | `OrionStarAI/Orion-14B-Base`, `OrionStarAI/Orion-14B-Chat`, etc. | | ✅︎ |
406406
| `OuroForCausalLM` | ouro | `ByteDance/Ouro-1.4B`, `ByteDance/Ouro-2.6B`, etc. | ✅︎ | |
407+
| `PanguEmbeddedForCausalLM` |openPangu-Embedded-7B | `FreedomIntelligence/openPangu-Embedded-7B-V1.1` | ✅︎ | ✅︎ |
408+
| `PanguUltraMoEForCausalLM` |openpangu-ultra-moe-718b-model | `FreedomIntelligence/openPangu-Ultra-MoE-718B-V1.1` | ✅︎ | ✅︎ |
407409
| `PhiForCausalLM` | Phi | `microsoft/phi-1_5`, `microsoft/phi-2`, etc. | ✅︎ | ✅︎ |
408410
| `Phi3ForCausalLM` | Phi-4, Phi-3 | `microsoft/Phi-4-mini-instruct`, `microsoft/Phi-4`, `microsoft/Phi-3-mini-4k-instruct`, `microsoft/Phi-3-mini-128k-instruct`, `microsoft/Phi-3-medium-128k-instruct`, etc. | ✅︎ | ✅︎ |
409411
| `PhiMoEForCausalLM` | Phi-3.5-MoE | `microsoft/Phi-3.5-MoE-instruct`, etc. | ✅︎ | ✅︎ |

tests/models/registry.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,26 @@ def check_available_online(
363363
"Olmo2ForCausalLM": _HfExamplesInfo("allenai/OLMo-2-0425-1B"),
364364
"Olmo3ForCausalLM": _HfExamplesInfo("shanearora/2025-sep-a-base-model"),
365365
"OlmoeForCausalLM": _HfExamplesInfo("allenai/OLMoE-1B-7B-0924-Instruct"),
366+
"OpenPanguMTPModel": _HfExamplesInfo(
367+
"FreedomIntelligence/openPangu-Ultra-MoE-718B-V1.1",
368+
trust_remote_code=True,
369+
is_available_online=False,
370+
),
366371
"OPTForCausalLM": _HfExamplesInfo(
367372
"facebook/opt-125m", {"1b": "facebook/opt-iml-max-1.3b"}
368373
),
369374
"OrionForCausalLM": _HfExamplesInfo(
370375
"OrionStarAI/Orion-14B-Chat", trust_remote_code=True
371376
),
372377
"OuroForCausalLM": _HfExamplesInfo("ByteDance/Ouro-1.4B", trust_remote_code=True),
378+
"PanguEmbeddedForCausalLM": _HfExamplesInfo(
379+
"FreedomIntelligence/openPangu-Embedded-7B-V1.1", trust_remote_code=True
380+
),
381+
"PanguUltraMoEForCausalLM": _HfExamplesInfo(
382+
"FreedomIntelligence/openPangu-Ultra-MoE-718B-V1.1",
383+
trust_remote_code=True,
384+
is_available_online=False,
385+
),
373386
"PersimmonForCausalLM": _HfExamplesInfo("adept/persimmon-8b-chat"),
374387
"PhiForCausalLM": _HfExamplesInfo("microsoft/phi-2"),
375388
"Phi3ForCausalLM": _HfExamplesInfo("microsoft/Phi-3-mini-4k-instruct"),

vllm/config/model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,8 @@ def is_deepseek_mla(self) -> bool:
12321232
"kimi_k2",
12331233
"kimi_linear",
12341234
"longcat_flash",
1235+
"pangu_ultra_moe",
1236+
"pangu_ultra_moe_mtp",
12351237
):
12361238
return self.hf_text_config.kv_lora_rank is not None
12371239
elif self.hf_text_config.model_type == "eagle":
@@ -1380,6 +1382,7 @@ def get_layers_start_end_indices(
13801382
or self.hf_config.model_type == "glm4_moe_mtp"
13811383
or self.hf_config.model_type == "ernie_mtp"
13821384
or self.hf_config.model_type == "qwen3_next_mtp"
1385+
or self.hf_config.model_type == "pangu_ultra_moe_mtp"
13831386
):
13841387
total_num_hidden_layers = getattr(
13851388
self.hf_text_config, "num_nextn_predict_layers", 0

vllm/config/speculative.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"qwen3_next_mtp",
4242
"mimo_mtp",
4343
"longcat_flash_mtp",
44+
"pangu_ultra_moe_mtp",
4445
"mtp",
4546
"suffix",
4647
]
@@ -51,6 +52,7 @@
5152
"ernie_mtp",
5253
"qwen3_next_mtp",
5354
"longcat_flash_mtp",
55+
"pangu_ultra_moe_mtp",
5456
)
5557

5658

@@ -179,6 +181,13 @@ def hf_config_override(hf_config: PretrainedConfig) -> PretrainedConfig:
179181
hf_config.update(
180182
{"n_predict": n_predict, "architectures": ["DeepSeekMTPModel"]}
181183
)
184+
if hf_config.model_type in ("pangu_ultra_moe"):
185+
hf_config.model_type = "pangu_ultra_moe_mtp"
186+
if hf_config.model_type == "pangu_ultra_moe_mtp":
187+
n_predict = getattr(hf_config, "num_nextn_predict_layers", None)
188+
hf_config.update(
189+
{"n_predict": n_predict, "architectures": ["OpenPanguMTPModel"]}
190+
)
182191

183192
if hf_config.architectures[0] == "MiMoForCausalLM":
184193
hf_config.model_type = "mimo_mtp"

0 commit comments

Comments
 (0)