Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kernel][Hardware][AMD][ROCm] Fix rocm/attention.cu compilation on ROCm 6.0.3 #8714

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion csrc/rocm/attention.cu
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ __device__ __forceinline__ _B16x4 addx4(const _B16x4& inp1,
for (int i = 0; i < 4; i++) {
t1.u = inp1[i];
t2.u = inp2[i];
res.b = t1.b + t2.b;
// See https://github.com/ROCm/ROCm/issues/2534
hip_bfloat16 t1b, t2b;
__hip_bfloat16 resb;
t1b.data = t1.b.data;
t2b.data = t2.b.data;
resb.data = (t1b + t2b).data;
res.b = resb;
// res.b = t1.b + t2.b;
ret[i] = res.u;
}
return ret;
Expand Down