[ROCm][Perf][DSv4.1] Mono decode on every backbone layer (#61082)

Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fangzhou Ai
2026-10-13 10:16:50 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent f47792af7f
commit cc2a6eea1a
13 changed files with 379 additions and 111 deletions
+11 -1
View File
@@ -282,7 +282,17 @@ class DeepseekV4DecoderLayer(nn.Module):
engram_mask: torch.Tensor | None = None,
) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
if self.mono is not None:
out = self.mono(self, x, positions, residual, post_mix, res_mix, pre_mix)
out = self.mono(
self,
x,
positions,
residual,
post_mix,
res_mix,
pre_mix,
engram_hashes,
engram_mask,
)
if out is not None:
return out
# Layer 0's attention seam projects the 2-D embedding with the folded