Skip to content

[HLSL] Test both B layouts in Wave MMA - #8912

Open
Jack Elliott (JoeCitizen) wants to merge 4 commits into
microsoft:mainfrom
JoeCitizen:linalg-hlk-submit-wave-mma
Open

Jack Elliott (JoeCitizen) wants to merge 4 commits into
microsoft:mainfrom
JoeCitizen:linalg-hlk-submit-wave-mma

Conversation

@JoeCitizen

@JoeCitizen Jack Elliott (JoeCitizen) commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Exercise RowMajor and ColumnMajor B in F16-to-F32 Wave MMA using an identity A
and asymmetric B.

Refs #7841.

Assisted-by: GitHub Copilot

Jack Elliott and others added 4 commits September 12, 2026 09:23
Add one 16x16x16 F16-to-F32 Wave MMA fixture using runtime-loaded identity
A, a non-symmetric B containing exact integers 1 through 256, and a zero
accumulator. Exercise RowMajor and ColumnMajor encodings of the same B
through the existing arithmetic runner and exact capability gates.

Check the descriptor store against the independent CPU multiplication
oracle. Separately check every native result accessor visit against that
CPU result and atomically retain per-cell visited and wrong-value flags.
Missing cells, invalid coordinates and a wrong duplicate owner cannot be
hidden by a correct store or another correct visit. Iterate each lane's
actual Length in a uniform maximum-length loop; exhausted and zero-length
lanes contribute no status. Preserve the existing x=row coordinate rule.

The fixture is independently derived from public proposal 0035; it does
not fix compiler/runtime behaviour or require a release note. This is a
local implementation checkpoint with AI-assisted rationale awaiting
human review, not approval for publication.

Assisted-by: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Move the result descriptor store after the integrity accessor loop. This
inspects the direct arithmetic-produced accumulator before a store lowering
can materialise or repack it and potentially mask an accessor defect.
The CHECK_RESULT_ACCESS=0 path still stores the arithmetic result directly.

This tightens fixture sequencing, not compiler/runtime behaviour, and does
not claim that masking has been observed on WARP. This local AI-assisted
rationale awaits human review and is not approval for publication.

Assisted-by: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Compare each native F32 accessor value's integer bits with the independent
CPU-expected bytes instead of a fast floating comparison. This avoids
nnan assumptions weakening detection of a corrupted NaN visit. Preserve
numeric equality for both signs of zero by comparing their magnitudes.

Keep direct post-MMA access before the descriptor store, the existing
sticky per-cell flags, finite inputs and all capability gates unchanged.
This is detector hardening, not a claim of an observed NaN IHV defect.
The local AI-assisted rationale awaits human review before publication.

Assisted-by: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 83725f5d-8e98-4c1d-91ee-ad47629e007b
Keep the RowMajor and ColumnMajor B cases and their independent CPU
product comparison. Remove the optional native-result accessor path,
expected/status resources, traversal and host status checks, and rename
the fixture to describe its layout-only scope.

Post-MMA accessor coverage is deliberately deferred. Existing arithmetic
cases retain their default RowMajor layout and capability gates.
This test-only scope cut and its AI-assisted rationale await human review.

Assisted-by: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d48ff7e3-e976-4c12-92fd-e039126a8243
@JoeCitizen
Jack Elliott (JoeCitizen) marked this pull request as ready for review September 11, 2026 23:03
Copilot AI balanced review requested due to automatic review settings September 11, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The layout is consistently applied to shader arguments, buffer encoding, validation, and execution.

Pull request overview

Adds Wave MMA execution coverage for both B matrix layouts using identity A and asymmetric B data.

Changes:

  • Parameterizes B layout in matrix multiply helpers.
  • Tests row-major and column-major B layouts against the CPU oracle.
File summaries
File Description
tools/clang/unittests/HLSLExec/LinAlgTests.cpp Adds B-layout handling and Wave MMA coverage.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

3 participants