[AMD] Fix Tensor Memory Aliasing (#19928)

This commit is contained in:
Bingxu Chen
2026-03-08 00:06:10 +08:00
committed by GitHub
parent 7da590d4d0
commit 17721b00fd
2 changed files with 4 additions and 4 deletions

View File

@@ -313,8 +313,8 @@ class Indexer(MultiPlatformOp):
q_rope, k_rope = self.rotary_emb(positions, q_rope, k_rope)
query[..., : self.rope_head_dim] = q_rope
key[..., : self.rope_head_dim] = k_rope
query[..., : self.rope_head_dim] = q_rope.clone()
key[..., : self.rope_head_dim] = k_rope.clone()
if enable_dual_stream:
current_stream = torch.cuda.current_stream()
@@ -352,7 +352,7 @@ class Indexer(MultiPlatformOp):
)
_, k_rope = self.rotary_emb(positions, k_rope, k_rope)
key[..., : self.rope_head_dim] = k_rope
key[..., : self.rope_head_dim] = k_rope.clone()
key = rotate_activation(key)
return key