[Bugfix][Models] Fix OpenPangu sleep mode with static sinks (#53696)

Signed-off-by: Ronald1995 <ronaldautomobile@163.com>
This commit is contained in:
Ronald
2026-09-14 21:05:47 +08:00
committed by GitHub
parent 1d0d1081c4
commit e0c04c7b4d
2 changed files with 11 additions and 9 deletions
@@ -152,8 +152,6 @@ class StaticSinkAttention(Attention, CustomOp):
attn_backend=attn_backend,
**kwargs,
)
CustomOp.__init__(self)
self.sink_len = sink_len
self.sink_populated = False
self.sink_key = None
+11 -7
View File
@@ -677,14 +677,18 @@ class OpenPanguSinkAttention(nn.Module):
},
)
else:
self.param_sink_value = torch.zeros(
(
self.param_sink_number,
self.num_kv_heads,
self.v_channels,
self.register_buffer(
"param_sink_value",
torch.zeros(
(
self.param_sink_number,
self.num_kv_heads,
self.v_channels,
),
device=current_platform.current_device(),
dtype=config.torch_dtype,
),
device=current_platform.current_device(),
dtype=config.torch_dtype,
persistent=False,
)
# To enable dummy run with out weight
self.post_weight_load()