[ROCm]fix(aiter): cast fp8 prefill output back to model dtype (#22626)

Co-authored-by: kk <43161300+kkHuang-amd@users.noreply.github.com>
This commit is contained in:
xiaobochen-amd
2026-04-14 00:25:09 -07:00
committed by GitHub
co-authored by kk
parent f97c608caa
commit d7ecab5113
@@ -2406,6 +2406,12 @@ class AiterAttnBackend(AttentionBackend):
v_descale=v_descale,
)
# The fp8bf16 aiter prefill kernel returns bf16 even when the
# model computes in fp16. Cast back so the attention output keeps
# the same dtype as the rest of the model activations.
if o.dtype != self.input_dtype:
o = o.to(self.input_dtype)
return o.view(-1, layer.tp_q_head_num * layer.head_dim)
def forward_decode(