[AMD] Fix AMD Nightly Test - Transformers 5.3.0 incompatibility and gemma2-27b kv issue (#21193)

Co-authored-by: bingxche <Bingxu.Chen@amd.com>
This commit is contained in:
YC Yen-Ching Tseng
2026-03-24 10:41:44 -07:00
committed by GitHub
co-authored by bingxche
parent 9f4d8ac99f
commit 71f5ae3f9a
2 changed files with 9 additions and 6 deletions
@@ -2360,10 +2360,8 @@ class AiterAttnBackend(AttentionBackend):
if layer.sliding_window_size is not None and layer.sliding_window_size > -1:
window_size = (layer.sliding_window_size, -1)
# page_table = self.token_to_kv_pool.translate_loc_from_full_to_swa(
# page_table
# )
page_table = self.forward_metadata.swa_page_table
if self.forward_metadata.swa_page_table is not None:
page_table = self.forward_metadata.swa_page_table
o = mha_batch_prefill_func(
q.contiguous().view(-1, layer.tp_q_head_num, layer.head_dim),
@@ -2496,7 +2494,8 @@ class AiterAttnBackend(AttentionBackend):
and layer.sliding_window_size > -1
):
window_size = (layer.sliding_window_size - 1, 0)
page_table = self.forward_metadata.swa_page_table
if self.forward_metadata.swa_page_table is not None:
page_table = self.forward_metadata.swa_page_table
o = torch.empty_like(q)
+5 -1
View File
@@ -477,7 +477,11 @@ class Grok1DecoderLayer(nn.Module):
self.layer_id = layer_id
self.alt_stream = alt_stream or torch.cuda.Stream()
rope_theta = config.rope_parameters["rope_theta"]
rope_params = getattr(config, "rope_parameters", None)
if rope_params and "rope_theta" in rope_params:
rope_theta = rope_params["rope_theta"]
else:
rope_theta = getattr(config, "rope_theta", 10000)
self.self_attn = Grok1Attention(
config=config,
hidden_size=self.hidden_size,