Skip to content

fix(ck-tile): Fix compiler issue - #9359

Merged
geyyer merged 2 commits into
developfrom
users/rogeyyer/ck/aick-1556
Jul 15, 2026
Merged

fix(ck-tile): Fix compiler issue#9359
geyyer merged 2 commits into
developfrom
users/rogeyyer/ck/aick-1556

Conversation

@geyyer

@geyyer geyyer commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Motivation

Bug causes miopen_composable_kernel_ut to fail due to numerical correctness mismatches in Composable Kernel GEMM/MX/blockscale/contraction paths. The failures are not build failures; the tests run, but device output does not match CPU/reference output, including large mismatches and NaN outputs.

Technical Details

__builtin_amdgcn_sched_barrier(0) with mask 0 = "no instruction of any kind may be reordered across this point, in either direction". It lowers to no hardware instruction — purely a compile-time scheduling boundary.

Test Plan

Confirm with the Compiler team

Test Result

TBD

Submission Checklist

JIRA ID : AICK-1556

@therock-pr-bot

therock-pr-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass
📝 PR Title/Description ✅ Pass
Forbidden Files ✅ Pass
🧪 Unit Test ❌ Fail Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/composablekernel/include/ck/tensor_operation/gpu/block/blockwise_gemm_pipeline_xdlops_blockscale_b_preshuffle_v1.hpp, projects/composablekernel/include/ck/tensor_operation/gpu/block/blockwise_gemm_pipeline_xdlops_moe_blockscale_b_preshuffle_v3.hpp, projects/composablekernel/include/ck/tensor_operation/gpu/block/blockwise_gemm_pipeline_xdlops_v3_mx_bpreshuffle.hpp; no test file found
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ Unit Test

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

@therock-pr-bot

therock-pr-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ Unit Test

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@geyyer geyyer changed the title Fix compiler issue fix(ck-tile): Fix compiler issue Jul 13, 2026
@geyyer
geyyer marked this pull request as ready for review July 14, 2026 19:02
@geyyer
geyyer requested a review from a team as a code owner July 14, 2026 19:02
Copilot AI review requested due to automatic review settings July 14, 2026 19:02

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.

Pull request overview

This PR introduces explicit AMDGPU compiler scheduling barriers in several Composable Kernel XDLops GEMM pipeline implementations to prevent problematic instruction reordering that can lead to numerical correctness mismatches (including large errors and NaNs) observed in miopen_composable_kernel_ut.

Changes:

  • Insert __builtin_amdgcn_sched_barrier(0) after specific prefetch/copy operations to enforce a compile-time scheduling boundary.
  • Add the same scheduling barrier before certain block_sync_lds() synchronization points in blockscale-related pipelines.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
projects/composablekernel/include/ck/tensor_operation/gpu/block/blockwise_gemm_pipeline_xdlops_v3_mx_bpreshuffle.hpp Adds scheduling barriers around global prefetch/copy steps to prevent compiler reordering across critical boundaries.
projects/composablekernel/include/ck/tensor_operation/gpu/block/blockwise_gemm_pipeline_xdlops_moe_blockscale_b_preshuffle_v3.hpp Adds a scheduling barrier immediately before an LDS block sync in the hot loop path.
projects/composablekernel/include/ck/tensor_operation/gpu/block/blockwise_gemm_pipeline_xdlops_blockscale_b_preshuffle_v1.hpp Adds a scheduling barrier before block_sync_lds() in the blockscale preshuffle pipeline sequence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shumway shumway 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.

Have you checked for performance regressions? Being correct is more important than performance, but if there's a significant regressions we should understand that and work on that, too.

@geyyer

geyyer commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Have you checked for performance regressions? Being correct is more important than performance, but if there's a significant regressions we should understand that and work on that, too.

Compiler team confirmed that "It lowers to no hardware instruction — purely a compile-time scheduling boundary.", so it has no effect on performance.

@geyyer
geyyer merged commit 0cb05ba into develop Jul 15, 2026
71 of 78 checks passed
@geyyer
geyyer deleted the users/rogeyyer/ck/aick-1556 branch July 15, 2026 17:33
assistant-librarian Bot pushed a commit to ROCm/composable_kernel that referenced this pull request Jul 15, 2026
fix(ck-tile): Fix compiler issue
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

## Motivation

Bug causes miopen_composable_kernel_ut to fail due to numerical
correctness mismatches in Composable Kernel
GEMM/MX/blockscale/contraction paths. The failures are not build
failures; the tests run, but device output does not match CPU/reference
output, including large mismatches and NaN outputs.

## Technical Details

__builtin_amdgcn_sched_barrier(0) with mask 0 = "no instruction of any
kind may be reordered across this point, in either direction". It lowers
to no hardware instruction — purely a compile-time scheduling boundary.

## Test Plan

Confirm with the Compiler team

## Test Result

TBD

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

JIRA ID : AICK-1556
pschang-phy pushed a commit that referenced this pull request Jul 17, 2026
## Motivation

Bug causes miopen_composable_kernel_ut to fail due to numerical
correctness mismatches in Composable Kernel
GEMM/MX/blockscale/contraction paths. The failures are not build
failures; the tests run, but device output does not match CPU/reference
output, including large mismatches and NaN outputs.

## Technical Details

__builtin_amdgcn_sched_barrier(0) with mask 0 = "no instruction of any
kind may be reordered across this point, in either direction". It lowers
to no hardware instruction — purely a compile-time scheduling boundary.

## Test Plan

Confirm with the Compiler team

## Test Result

TBD

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

JIRA ID : AICK-1556
shumway pushed a commit to ROCm/composable_kernel that referenced this pull request Aug 18, 2026
fix(ck-tile): Fix compiler issue

## Motivation

Bug causes miopen_composable_kernel_ut to fail due to numerical
correctness mismatches in Composable Kernel
GEMM/MX/blockscale/contraction paths. The failures are not build
failures; the tests run, but device output does not match CPU/reference
output, including large mismatches and NaN outputs.

## Technical Details

__builtin_amdgcn_sched_barrier(0) with mask 0 = "no instruction of any
kind may be reordered across this point, in either direction". It lowers
to no hardware instruction — purely a compile-time scheduling boundary.

## Test Plan

Confirm with the Compiler team

## Test Result

TBD

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

JIRA ID : AICK-1556
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants