Skip to content

[0035] Fix accumulation to groupshared - #927

Merged
Chris B (llvm-beanz) merged 6 commits into
microsoft:mainfrom
llvm-beanz:925
Sep 9, 2026
Merged

Chris B (llvm-beanz) merged 6 commits into
microsoft:mainfrom
llvm-beanz:925

Conversation

@llvm-beanz

Copy link
Copy Markdown
Collaborator

This corrects some errors I recently introduced to the spec and removes some undesirable complexitly.

When accumulating to groupshared memory we should effectively always treat the groupshared memory as if it is a blob of bytes of the matrix element type, and no data conversions are applied.

Fixes #925

This corrects some errors I recently introduced to the spec and removes
some undesirable complexitly.

When accumulating to groupshared memory we should effectively always
treat the groupshared memory as if it is a blob of bytes of the matrix
element type, and no data conversions are applied.

Fixes microsoft#925
Comment thread proposals/0035-linalg-matrix.md Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Validation rules need to be updated

Comment thread proposals/0035-linalg-matrix.md
Comment thread proposals/0035-linalg-matrix.md Outdated
Comment thread proposals/0035-linalg-matrix.md Outdated
Chris B (llvm-beanz) and others added 2 commits September 3, 2026 16:57
Co-authored-by: Damyan Pepper <damyanp@microsoft.com>
Comment thread proposals/0035-linalg-matrix.md Outdated
Comment thread proposals/0035-linalg-matrix.md Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Offset * element byte width must be 128-byte aligned from the base offset, and stride * element byte width

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This sentence got rewritten in PR #924.

@V-FEXrt

Copy link
Copy Markdown
Collaborator

Sorry for drip feeding comments, I wanted to do a deeper read and kept finding small things. That should be everything!

Comment thread proposals/0035-linalg-matrix.md Outdated
MatrixLayoutEnum Layout);

#ifdef __hlsl_dx_compiler
template <ComponentEnum TargetCompTy = ComponentTy, typename T,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment from copilot on another PR that belongs over here!

TargetCompTy is now accepted but never used, so calls such as InterlockedAccumulateComponentType::I32(...) compile while producing exactly the same F32 operation as the default call. Since the DXIL target-type operand was removed, keeping this argument silently misrepresents the operation's element interpretation; remove the template parameter and update the affected call sites/tests so obsolete explicit target types are rejected rather than ignored.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'll remove that. Thanks for the catch!

@llvm-beanz
Chris B (llvm-beanz) merged commit 1672941 into microsoft:main Sep 9, 2026
3 of 4 checks passed
@github-project-automation github-project-automation Bot moved this to Triaged in HLSL Triage Sep 9, 2026
Ashley Coleman (V-FEXrt) added a commit to microsoft/DirectXShaderCompiler that referenced this pull request Sep 9, 2026
Implements the spec changes as defined by
microsoft/hlsl-specs#927

- TargetType has been removed from
`dx.op.linAlgMatrixAccumulateToMemory`
- TG Matrix is now allowed in `InterlockedAccumulate` to gs memory

Fixes: #8897

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Triaged

Development

Successfully merging this pull request may close these issues.

[0035] Discrepancy in Interlockedaccumulate to Groupshared : (1) Clarify Type requirement for MatrixTy and GSMem type (2) MatrixScope (Wave + TG?)

3 participants