Skip to content

feat(stinkytofu): issue a barrier once its dependency threshold is met - #14734

Merged
KKyang merged 6 commits into
ROCm:developfrom
hcman2:users/hcman2/preserve_barrier
Nov 2, 2026
Merged

KKyang merged 6 commits into
ROCm:developfrom
hcman2:users/hcman2/preserve_barrier

Conversation

@hcman2

@hcman2 hcman2 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

JIRA ID: https://amd-hub.atlassian.net/browse/AIHPBLAS-5417

Summary

When a barrier is in both the after and before threshold maps, averaging those thresholds can no longer place it earlier than the parent-WMMA drain. depThreshold (the last WMMA a feeding ds_load depends on, plus the WAR gate and that load's drain) is a floor. Even when the overlap-after placement is later than that drain, the averaged result stays at or after depThreshold.

A barrier issues as soon as its WMMA threshold is met. WmmaBarrierCoverCycles and the extra WMMA tail (default 4) are removed. The threshold already includes the last dependent WMMA and the load's drain; holding the barrier for another tail skipped it and let a later barrier be selected. --wmma-barrier-cover-cycles and the WmmaBarrierCoverCycles module option are still accepted, but they only warn and are ignored.

When an after threshold is earlier than the before threshold and the claim windows do not overlap, the same-token tensor_load still sits between the two barriers: barrierAfter → tensor_load → barrierBefore. A tensor_load is the next LDS producer, so def-use does not place it after the barrier; that order is now an explicit constraint. Only pairs whose windows actually overlap become overlap candidates and are eligible to merge.

Technical Details

Test Plan

Test Result

Submission Checklist

The threshold already includes the last WMMA a feeding ds_load depends on and that load's drain. Holding a met barrier for another tail of WMMAs skipped it and let a later barrier be selected.
@hcman2
hcman2 requested a review from a team as a code owner October 30, 2026 03:10
@hcman2 hcman2 changed the title feat(stinkytofu): feat(stinkytofu): issue a gfx1250 barrier once its dependency threshold is met Oct 30, 2026
@hcman2 hcman2 changed the title feat(stinkytofu): issue a gfx1250 barrier once its dependency threshold is met feat(stinkytofu): issue a barrier once its dependency threshold is met Oct 30, 2026
@therock-pr-bot

therock-pr-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning 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: shared/stinkytofu/include/stinkytofu/bindings/python/Module.hpp, shared/stinkytofu/include/stinkytofu/core/Types.hpp, shared/stinkytofu/include/stinkytofu/transforms/asm/StinkyMergeBarrierPass.hpp, shared/stinkytofu/src/conversion/rocisa/ToStinkyTofuUtils.cpp, shared/stinkytofu/src/pipeline/backend/Gfx1250Backend.cpp (+5 more); no test file found
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

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

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project check has failed because the head coverage (51.10%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14734      +/-   ##
===========================================
+ Coverage    77.34%   77.36%   +0.01%     
===========================================
  Files         2893     2893              
  Lines       486262   486371     +109     
  Branches     73502    73525      +23     
===========================================
+ Hits        376094   376238     +144     
+ Misses       85342    85314      -28     
+ Partials     24826    24819       -7     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 51.10% <ø> (+0.29%) ⬆️
TensileLite-Unit 84.17% <ø> (+0.02%) ⬆️
hipBLAS 90.62% <ø> (ø) Carriedforward from 57bf1b3
hipBLASLt 68.59% <ø> (ø)
hipCUB 82.68% <ø> (ø) Carriedforward from 57bf1b3
hipDNN 86.92% <ø> (ø) Carriedforward from 57bf1b3
hipFFT 43.18% <ø> (ø) Carriedforward from 57bf1b3
hipRAND 76.12% <ø> (ø) Carriedforward from 57bf1b3
hipSOLVER 69.67% <ø> (ø) Carriedforward from 57bf1b3
hipSPARSE 87.03% <ø> (ø) Carriedforward from 57bf1b3
rocBLAS 68.96% <ø> (ø) Carriedforward from 57bf1b3
rocFFT 47.36% <ø> (ø) Carriedforward from 57bf1b3
rocRAND 57.32% <ø> (ø) Carriedforward from 57bf1b3
rocSOLVER 76.74% <ø> (ø) Carriedforward from 57bf1b3
rocSPARSE 83.54% <ø> (ø) Carriedforward from 57bf1b3
rocThrust 93.15% <ø> (ø) Carriedforward from 57bf1b3

*This pull request uses carry forward flags. Click here to find out more.
see 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hcman2
hcman2 force-pushed the users/hcman2/preserve_barrier branch from f580d9b to 80c08a9 Compare October 30, 2026 08:21
@hcman2
hcman2 force-pushed the users/hcman2/preserve_barrier branch from 80c08a9 to 57bf1b3 Compare October 30, 2026 08:33
@hcman2

hcman2 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

hipblaslt test passed on B0

@hcman2

hcman2 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

tox passed except sk

@hcman2
hcman2 force-pushed the users/hcman2/preserve_barrier branch from e838579 to 042115c Compare October 30, 2026 10:01
@KKyang
KKyang merged commit 92f853c into ROCm:develop Nov 2, 2026
165 of 170 checks passed
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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.

2 participants