Skip to content

fix(stinkytofu): fix potential bug when calculating overlap - #12169

Merged
hcman2 merged 1 commit into
ROCm:developfrom
hcman2:users/hcman2/fix_ds_2
Sep 16, 2026
Merged

hcman2 merged 1 commit into
ROCm:developfrom
hcman2:users/hcman2/fix_ds_2

Conversation

@hcman2

@hcman2 hcman2 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

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

Summary

Fix CDNA5 Layer 2 exclusive after/before overlap detection: claim the full unclamped after demand (wmmaWindowsNeeded + latencyWmmaBudget) instead of the promote-clamped issue window.
Previously, after barriers whose base threshold exceeded issuedCount could miss overlap with earlier before-barriers, so they stayed pinned at the region end.
Clean up Layer 2 structs/helpers without changing scheduling policy beyond the claim-window fix; update unit tests accordingly.

Motivation

Layer 2 decides whether exclusive after/before barrier groups fight for the same WMMA windows. The after claim window used overlapWmmaWindow, which is capped to adjustedAfterThreshold / issuedCount for promote timing. When base after demand was large (issue windows + drain latency) but the region had few WMMAs, the claimed interval shrank and failed to overlap a nearby before group — so no reconcile ran and the after barrier stayed at the end.

Technical Details

Overlap claim (behavior change): after exclusive groups now claim wmmaWindowsNeeded + latencyWmmaBudget (unclamped). Promote threshold still clamps to issuedCount.
Proportional split demand: after still uses issue-only wmmaWindowsNeeded; before uses its claim window.
Cleanup: remove dead overlapWmmaWindow; rename summary fields (claimWindow / splitNeeded / pendingThreshold); split after/before group builders; fold pending thresholds and descendants into the group; write setGroupThreshold once after optional tensor-load spacing.
Tests: rebuild the “separate windows” fixture so lastOverlap > wmmaWindowsNeeded still yields non-overlap under the new claim; fold end-to-end merge checks into that test; drop duplicated/dummy smoke tests.

Test plan

unit_tests --gtest_filter='CDNA5ReadyQueueTest.:DAGSchedulerPassTest.:InFlightQueue*'

DAGSchedulerPassTest.Layer2*

hipblaslt / tensilelite kernel spot-check (e.g. mxf4 barrier placement) as needed

Test Result

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Sep 16, 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/src/transforms/asm/dag/CDNA5.hpp, shared/stinkytofu/tests/unit/asm/DAGSchedulerPassTest.cpp; 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

Copy link
Copy Markdown

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

@hcman2

hcman2 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

tox passed for non streamk cases on a0 machine except unsupported feature(gl2 prefetch)

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #12169   +/-   ##
========================================
  Coverage    70.29%   70.29%           
========================================
  Files         2812     2812           
  Lines       462735   462769   +34     
  Branches     68113    68122    +9     
========================================
+ Hits        325241   325271   +30     
- Misses      113939   113943    +4     
  Partials     23555    23555           
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 46.40% <ø> (+0.02%) ⬆️
TensileLite-Unit 76.10% <ø> (+<0.01%) ⬆️
hipBLAS 90.62% <ø> (ø) Carriedforward from dc071d1
hipBLASLt 35.24% <ø> (ø) Carriedforward from dc071d1
hipCUB 82.68% <ø> (ø) Carriedforward from dc071d1
hipDNN 87.01% <ø> (ø) Carriedforward from dc071d1
hipFFT 43.07% <ø> (ø) Carriedforward from dc071d1
hipRAND 76.12% <ø> (ø) Carriedforward from dc071d1
hipSOLVER 68.92% <ø> (ø) Carriedforward from dc071d1
hipSPARSE 86.99% <ø> (ø) Carriedforward from dc071d1
rocBLAS 48.31% <ø> (ø) Carriedforward from dc071d1
rocFFT 47.88% <ø> (ø) Carriedforward from dc071d1
rocRAND 57.42% <ø> (ø) Carriedforward from dc071d1
rocSOLVER 76.83% <ø> (ø) Carriedforward from dc071d1
rocSPARSE 74.61% <ø> (ø) Carriedforward from dc071d1
rocThrust 91.60% <ø> (ø) Carriedforward from dc071d1

*This pull request uses carry forward flags. Click here to find out more.
see 6 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 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

[----------] Global test environment tear-down
[==========] 67519 tests from 37 test suites ran. (688005 ms total)
[ PASSED ] 67498 tests. passed on b0 machine

@hcman2
hcman2 merged commit 8b911e1 into ROCm:develop Sep 16, 2026
230 of 240 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