Add debug logging for BF16 dequant to find missing attrs
This commit is contained in:
@@ -1728,10 +1728,16 @@ class DeepseekV4Model(nn.Module):
|
||||
# BF16 dequantization: attention projections (except wo_a)
|
||||
for proj_name in bf16_proj_names:
|
||||
if not hasattr(attn, proj_name):
|
||||
if layer_idx == 0:
|
||||
print(f"[CLAWMINE] Layer 0: {proj_name} NOT FOUND on attn (type={type(attn).__name__})")
|
||||
continue
|
||||
mod = getattr(attn, proj_name)
|
||||
if not hasattr(mod, "weight"):
|
||||
if layer_idx == 0:
|
||||
print(f"[CLAWMINE] Layer 0: {proj_name} has no weight attr")
|
||||
continue
|
||||
if layer_idx == 0:
|
||||
print(f"[CLAWMINE] Layer 0: {proj_name} weight dtype={mod.weight.dtype}")
|
||||
if mod.weight.dtype in (torch.uint8, torch.int8):
|
||||
E2M1_LUT = torch.tensor([0, 0.5, 1, 1.5, 2, 3, 4, 6], dtype=torch.bfloat16)
|
||||
self._dequant_nvfp4_to_bf16(mod, E2M1_LUT)
|
||||
|
||||
Reference in New Issue
Block a user