Skip to content

kernels: use __float2bfloat16 in batched_embed_nvfp4 so strix-hip builds (second break from #195) - #204

Open
AzeezIsh wants to merge 1 commit into
mainfrom
fix/hip-embed-nvfp4-bf16
Open

AzeezIsh wants to merge 1 commit into
mainfrom
fix/hip-embed-nvfp4-bf16

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

What

batched_embed_nvfp4 (added by #195 in kernels/gb10/common/embed_from_argmax.cu) calls __float2bfloat16_rn. HIP has no _rn variant, and this .cu is symlinked into the strix-hip targets, so main stops building for gfx1151. __float2bfloat16 rounds to nearest even on both CUDA and HIP, so the output does not change.

This is the second strix-hip break on main. The first is #174's atlas_pdl.cuh and friends, which #197 fixes. AMD needs both.

The other _rn call sites are only in GB10-only targets. I checked that none of them are symlinked into strix-hip.

Verified

🤖 Generated with Claude Code

embed_from_argmax.cu is shared into kernels/strix-hip/common by symlink.
HIP's bf16 header has no __float2bfloat16_rn, so the HIP build failed with
"use of undeclared identifier". __float2bfloat16 is round-to-nearest-even
on both CUDA and ROCm (static_cast<__bf16>), so GB10 output is unchanged;
line 123 of the same file already uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

AMD train candidate gate: main 504063a + #197 + #204 (merged as b9ab4ed54), on strix (gfx1151, 64 GB):

So #204 together with #197 gives AMD a working main with no accuracy regression. A Flash-Next NVFP4 regression check of #195 on framework is still running.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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