Skip to content

Fix UBSan invalid-shift-exponent in bf16 packa kernel#17

Open
js00070 wants to merge 1 commit into
amd:devfrom
js00070:zhiyi/ubfix
Open

Fix UBSan invalid-shift-exponent in bf16 packa kernel#17
js00070 wants to merge 1 commit into
amd:devfrom
js00070:zhiyi/ubfix

Conversation

@js00070

@js00070 js00070 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

dlp_packa_mr16_bf16bf16f32of32_row_major shifted a 32-bit unsigned by 32 when KC is a multiple of 32 (k_left == 0), which is UB. The mask is only consumed under if (k_left > 0) guards, so guard the shift to produce 0 in that case.

dlp_packa_mr16_bf16bf16f32of32_row_major shifted a 32-bit unsigned by 32
when KC is a multiple of 32 (k_left == 0), which is UB. The mask is only
consumed under if (k_left > 0) guards, so guard the shift to produce 0 in
that case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant