Fix: layer.self_attn → layer.attn (model uses attn, not self_attn)

This commit is contained in:
2026-05-19 00:14:09 +00:00
parent 201a40e6c4
commit 540e7ee8fc

View File

@@ -1648,7 +1648,7 @@ class DeepseekV4Model(nn.Module):
for layer in islice(self.layers, self.start_layer, self.end_layer):
layer.ffn.finalize_mega_moe_weights()
# Quantize wo_a to FP8 (checkpoint has bfloat16, forward expects FP8)
attn = layer.self_attn
attn = layer.attn
if hasattr(attn, 'wo_a') and attn.wo_a.weight.dtype == torch.bfloat16:
self._quantize_wo_a_to_fp8(attn.wo_a)