[Bugfix][Models] Fix OpenPangu sleep mode with static sinks (#53696)
Signed-off-by: Ronald1995 <ronaldautomobile@163.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user