@@ -291,13 +291,10 @@ def get_score(self, recipe: QuantRecipe) -> float:
291291 total_score += importance .cpu ().item ()
292292 continue
293293
294- if parallel_state .expert_model_parallel_group .is_initialized ():
295- # TODO: Support expert model parallelism for score estimation
296- warnings .warn ("AutoQuantize does not support expert model parallelism yet." )
297294 importance = importance .cpu ()
298295 importance = DistributedProcessGroup .get_dist_syncd_obj (
299296 importance ,
300- [parallel_state .tensor_parallel_group , parallel_state .data_parallel_group ],
297+ [parallel_state .tensor_parallel_group , parallel_state .data_parallel_group , parallel_state . expert_model_parallel_group ],
301298 sum ,
302299 )
303300 total_score += importance .item ()
@@ -318,13 +315,9 @@ def get_cost(self, recipe: QuantRecipe) -> float:
318315 cost += weight_size * recipe .compression
319316 continue
320317
321- if parallel_state .expert_model_parallel_group .is_initialized ():
322- # TODO: Support expert model parallelism
323- warnings .warn ("AutoQuantize does not support expert model parallelism yet." )
324-
325318 weight_size = DistributedProcessGroup .get_dist_syncd_obj (
326319 weight_size ,
327- [parallel_state .tensor_parallel_group ],
320+ [parallel_state .tensor_parallel_group , parallel_state . expert_model_parallel_group ],
328321 sum ,
329322 )
330323
@@ -362,6 +355,8 @@ class _AutoQuantizeBaseSearcher(BaseSearcher, ABC):
362355 # gate_proj, up_proj, down_proj for Qwen3 like MoE models
363356 r"^(.*?\.mlp\.experts)\.\d+\.(gate_proj|up_proj|down_proj)$" ,
364357 r"^(.*?\.mixer\.experts)\.\d+\.(up_proj|down_proj)$" , # NemotronH MoE experts
358+ # NemotronH MoE experts in MCore naming (linear_fc1=gate+up fused, linear_fc2=down)
359+ r"^(.*?\.mlp\.experts\.local_experts)\.\d+\.(linear_fc1|linear_fc2)$" ,
365360 r"^(.*?)\.(gate_proj|up_proj)$" , # gate_proj, up_proj for llama like models
366361 r"^(.*?)\.(\d+\.(w1|w2|w3))$" , # mixtral experts
367362 r"^(.*?)\.((w1_linear|w2_linear|w3_linear)\.\d+)$" , # dbrx experts
0 commit comments