[Bugfix][Quantization] Refresh online NVFP4 scales before reload post-processing (#57954)

Signed-off-by: S1ro1 <matej.sirovatka@gmail.com>
Signed-off-by: aoshen02 <aoshen02@users.noreply.github.com>
Co-authored-by: aoshen02 <aoshen02@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: aoshen02 <aoshen@inferact.ai>
This commit is contained in:
Matej Sirovatka
2026-09-24 18:36:08 -07:00
committed by GitHub
co-authored by aoshen02 Claude Opus 5 aoshen02
parent 16070ed7e9
commit 3652f35e7c
4 changed files with 104 additions and 20 deletions
@@ -178,6 +178,14 @@ class Nvfp4OnlineMoEMethod(OnlineMoEMethodBase):
routing_tables=layer._expert_routing_tables(),
per_token_activation=True,
)
else:
# Reload creates new scale tensors; derived kernel scales must use
# their new values before layerwise reload restores captured storage.
assert self.moe_quant_config is not None
assert self.moe_quant_config.g1_alphas is not None
assert self.moe_quant_config.g2_alphas is not None
self.moe_quant_config.g1_alphas.copy_(w13_scale_2)
self.moe_quant_config.g2_alphas.copy_(w2_scale_2)
self.moe_kernel.fused_experts.process_weights_after_loading(layer)