[Misc] Pass attention to impl backend (#12218)

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan
2025-01-20 23:25:28 +08:00
committed by GitHub
parent 5f0ec3935a
commit 86bfb6dba7
12 changed files with 86 additions and 78 deletions
+3 -5
View File
@@ -243,8 +243,7 @@ def unified_attention(
attn_metadata = forward_context.attn_metadata
self = forward_context.attn_layers[layer_name]
kv_cache = self.kv_cache[forward_context.virtual_engine]
return self.impl.forward(query, key, value, kv_cache, attn_metadata,
self._k_scale, self._v_scale)
return self.impl.forward(self, query, key, value, kv_cache, attn_metadata)
def unified_attention_fake(
@@ -276,13 +275,12 @@ def unified_attention_with_output(
attn_metadata = forward_context.attn_metadata
self = forward_context.attn_layers[layer_name]
kv_cache = self.kv_cache[forward_context.virtual_engine]
self.impl.forward(query,
self.impl.forward(self,
query,
key,
value,
kv_cache,
attn_metadata,
self._k_scale,
self._v_scale,
output=output)