From d68e113af1e6723b5f30ec18ef69399fac9e5234 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Tue, 12 May 2026 20:57:04 +0000 Subject: [PATCH] remove spammy shit --- patches/deepseek_v4.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/patches/deepseek_v4.py b/patches/deepseek_v4.py index 8102682..25f045b 100644 --- a/patches/deepseek_v4.py +++ b/patches/deepseek_v4.py @@ -669,14 +669,6 @@ 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) @@ -2082,11 +2074,7 @@ class DeepseekV4Model(nn.Module): delattr(mod, attr) from vllm.model_executor.layers.linear import UnquantizedLinearMethod mod.quant_method = UnquantizedLinearMethod() - # Safety check: UnquantizedLinearMethod with FP8 weight will crash CUBLAS - if mod.weight.dtype in (torch.float8_e4m3fn, torch.float8_e5m2): - print(f"[NVFP4-FP8-CRASH] {getattr(mod, 'prefix', 'unknown')}: " - f"weight is {mod.weight.dtype} but quant_method=UnquantizedLinearMethod! " - f"This will crash CUBLAS.") + for attr in ("weight_scale", "weight_scale_2", "input_scale"): if hasattr(mod, attr): delattr(mod, attr) @@ -2192,8 +2180,6 @@ class DeepseekV4Model(nn.Module): # fused_wkv_wgate.weight = cat([wkv, wgate], dim=0) → (2*head_dim, hidden_size) w_fused = torch.cat([wkv_dequant, wgate_dequant], dim=0) - # DEBUG: log shapes to diagnose compressor weight mismatch - print(f"NVFP4 compressor layer {layer_idx}: wkv={wkv_dequant.shape}, wgate={wgate_dequant.shape}, fused={w_fused.shape}, existing_param={fused_mod.weight.shape}") # Replace the weight fused_mod.weight = torch.nn.Parameter(w_fused, requires_grad=False)