Repository navigation
strix-hip: fix main's AMD build (vision_encoder raw mma.sync since #397) - #444
Merged
Merged
Conversation
…d broken since #397) #397 added a raw mma.sync.m16n8k16 asm block to the shared vision encoder (kernels/gb10/qwen3.6-35b-a3b/nvfp4/vision_encoder.cu). hipcc rejects the '+f' constraint, so every strix-hip build of main fails at atlas-kernels. Add crates/atlas-kernels/hip/compat/atlas_ptx_emu.h: wave32 stand-ins for mma.sync.m16n8k16 (bf16/f16 -> f32), ldmatrix(.trans), cp.async, e2m1 and e4m3 that reproduce the PTX fragment layouts lane for lane, so kernels keep their fragment code and only the instruction changes under __HIP_PLATFORM_AMD__. hip/tests/ptx_emu_test.hip checks them against a CPU reference on gfx1151 (rel err <= 1.2e-6). NVIDIA code is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since #397 (merged 2026-12-01), every strix-hip build of main fails in
atlas-kernels. The cause is the rawmma.sync.aligned.m16n8k16asm invit_mma_bf16(kernels/gb10/qwen3.6-35b-a3b/nvfp4/vision_encoder.cu), whose"+f"constraint hipcc rejects. Many targets share that file, so no Strix Halo build of main works.Fix
crates/atlas-kernels/hip/compat/atlas_ptx_emu.h, which provides wave32 stand-ins that match the PTX lane for lane:mma.sync.m16n8k16(bf16/f16 → f32)ldmatrix/ldmatrix.transcp.asyncvit_mma_bf16callsatlas_emu::mma_m16n8k16under__HIP_PLATFORM_AMD__. The NVIDIA path is byte-for-byte unchanged.crates/atlas-kernels/hip/tests/ptx_emu_test.hip, a standalone GPU test of the stand-ins against a CPU reference.The stand-ins are for correctness, not speed. The
amd/ling-3.2-airbranch (Ling on strix-hip) is built on the same header.Verified
On Framework Desktop (gfx1151, ROCm 7.13), at
e5530ce4d(main) plus this commit:BUILD OK all b900d712b).vision_encodercompiles into the strix-hip code objects.ptx_emu_test.hip:PTX-EMU OK. Relative error ≤1.2e-6, and 0 of 256 e4m3 codes decode wrong.Not verified
amd/ling-3.2-air, where DevLab Strix serve runs pass.#if defined(__HIP_PLATFORM_AMD__).🤖 Generated with Claude Code