[ModelOpt][PP] Keep BF16 shared experts out of the NVFP4 fusion so TP1 pipeline stages can load (#40628)
This commit is contained in:
@@ -1497,6 +1497,15 @@ class ModelOptFp4Config(ModelOptQuantConfig):
|
||||
def get_min_capability(cls) -> int:
|
||||
return 80
|
||||
|
||||
def can_fuse_shared_expert(self) -> bool:
|
||||
# A shared-expert body kept BF16 via exclude_modules cannot share the packed
|
||||
# FP4 FusedMoE buffers. The shared_expert_gate is a separate linear (kept
|
||||
# BF16 by e.g. Qwen3-Next NVFP4 checkpoints) and must not veto fusion.
|
||||
return not any(
|
||||
"shared_expert" in name and "shared_expert_gate" not in name
|
||||
for name in self.exclude_modules
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def common_group_size(cfg: dict) -> int:
|
||||
"""Return the unique group_size across the config; raise if missing/mismatched."""
|
||||
|
||||
Reference in New Issue
Block a user