debug: add shape/dtype logging to finalize_weights

This commit is contained in:
2026-05-11 07:13:44 +00:00
parent b1cf4232ee
commit b532742530

View File

@@ -625,6 +625,14 @@ class DeepseekV4MegaMoEExperts(nn.Module):
self._check_runtime_supported()
from deep_gemm.mega import transform_nvfp4_weights_for_mega_moe
# Debug: log shapes/dtypes before transform
print(f"[NVFP4-MoE] w13_weight: shape={self.w13_weight.shape} dtype={self.w13_weight.dtype}")
print(f"[NVFP4-MoE] w13_weight_scale: shape={self.w13_weight_scale.shape} dtype={self.w13_weight_scale.dtype}")
print(f"[NVFP4-MoE] w13_weight_scale_2: shape={self.w13_weight_scale_2.shape} dtype={self.w13_weight_scale_2.dtype}")
print(f"[NVFP4-MoE] w2_weight: shape={self.w2_weight.shape} dtype={self.w2_weight.dtype}")
print(f"[NVFP4-MoE] w2_weight_scale: shape={self.w2_weight_scale.shape} dtype={self.w2_weight_scale.dtype}")
print(f"[NVFP4-MoE] w2_weight_scale_2: shape={self.w2_weight_scale_2.shape} dtype={self.w2_weight_scale_2.dtype}")
# === Native NVFP4 path ===
# The DeepGEMM nvfp4 mega_moe kernel consumes NVFP4 directly:
# - E2M1 packed uint8 (same as checkpoint)