Repository navigation
fix(nf12): run BF16T through split-K dispatcher - #3716
Merged
Merged
Conversation
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.
TL;DR
Route the vendored HIP BF16T WMMA reference through the same tile and split-K dispatcher as NF12. A split-K plan can no longer launch
grid.z > 1while the BF16T kernel hardcodeskSplits=1, skips the partial plane, and feeds uninitialized workspace to the reducer.1. The problem
The host plan selected split 4 for
m=16,n=4096,k=4096, but the BF16T branch always instantiatedkSplits=1. It wrote directly toout; the host still launched the reducer frompartial, whose contents were uninitialized.flowchart TD A["wmma_plan: splits 4"] --> B["grid.z = 4"] B --> C["BF16T kernel: kSplits = 1"] C --> D["write out directly"] B --> E["wmma_reduce_kernel"] E --> F["read uninitialized partial"] F --> X["corrupt output"] style X fill:#fee,stroke:#b222. The new flow
flowchart TD A["linear_wmma_impl<WeightSource>"] --> B["wmma_plan"] B --> C["NF12_AD_SWITCH for NF12 or BF16T"] C --> D["NF12_AD_DISPATCH: 1, 2, 4, or 8"] D --> E["wmma_kernel with matching kSplits"] E --> F{"splits == 1?"} F -->|"yes"| G["write BF16 output"] F -->|"no"| H["write FP32 partial"] H --> I["wmma_reduce_kernel"] style G fill:#efe,stroke:#282 style I fill:#efe,stroke:#282The same flow is documented in
docs/nf12-hip-device-workspace.md.Upstream
The implementation is already present in dphnAI/nf12 PR #3 commit
10a8825. This PR also adds upstream coverage on the same PR branch in commit9fc6283:Coverage
kSplits=1BF16T path.4096 x 4096,m=164096 x 4096,m=642048 x 4096,m=16Validation
The 90 HIP tests require a ROCm RDNA4 device and were skipped on this host. PR #3's existing R9700 validation establishes the upstream hardware baseline; the new split-plan cases are pending a RDNA4 runner.