Skip to content

fix(miopen): restore gfx1201 backward-data performance lost to the split-K cleanup - #13415

Merged
yassinsolim merged 3 commits into
developfrom
users/ysoliman/gfx1201-retune-splitk
Oct 20, 2026
Merged

yassinsolim merged 3 commits into
developfrom
users/ysoliman/gfx1201-retune-splitk

Conversation

@yassinsolim

@yassinsolim yassinsolim commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

JIRA ID: ROCM-29026

Motivation

#12088 removed 638 invalid CK entries from the gfx1201 system database. 169 of them were the
fastest recorded winner for their key, so the removal cost measured performance. That PR said so
and asked for a follow-up re-tune. This is that follow-up for the split-K group.

117 of the 169 are split-K entries. Their surviving winner is GemmBwdRest 95 times, and 19 keys
lost their only entry and fall back to a runtime find. The recorded cost was a median 6.15x, worst
69.5x on 1024-1-1-7x7-256-1-1-800-0x0-1x1-1x1-0-NCHW-BF16-B, which went from 0.4843 ms to
33.6636 ms.

The other 52 are the large-tensor group and are not touched here. #13421 handles those.

Technical Details

Each of the 117 shapes was re-tuned on gfx1201 with MIOPEN_FIND_ENFORCE=SEARCH restricted to
ConvHipImplicitGemmGroupBwdXdlops. The find-db and perf-db rows added by this PR are the rows
MIOpen itself serialized during that search, not hand-built strings.

property value
find-db entries added 117 (19 new lines, 98 amended)
perf-db entries added 108 (107 new lines, 1 amended)
solver ConvHipImplicitGemmGroupBwdXdlops, zero entries outside it
split-K suffix on every new config kbatch 1
numerically verified 117/117
lines removed 0

Every tuned config carries kbatch 1. The search did not reselect a split-K configuration for any
of these shapes, so this does not reintroduce the class #12088 removed, and it stays clear of
the split-K defect in #12942.

117 find-db keys map to only 108 perf-db keys, because the perf-db key drops the output spatial
dimensions. Nine perf-db keys are shared by two find-db keys, and five of those received different
tuned configs. Those five were resolved by measuring every (find-db key, candidate config) pair and
keeping the config with the lower total time, then re-running the find for the ten affected keys
with the chosen config so the recorded time belongs to the config that ships.

Performance consequence

Paired A/B on one node, one build, back to back, default find mode and a fresh user database, which
is what a user gets. Two full replicates.

metric replicate 1 replicate 2
total kernel time over the 117 shapes 266.4 ms -> 56.3 ms 266.4 ms -> 56.3 ms
aggregate 4.73x 4.73x
median per shape 3.77x 3.59x
geomean per shape 3.71x 3.71x
shapes at 10x or better 28 28
best shape 54.4x 57.9x

The solver MIOpen selects changes from GemmBwdRest on 95 shapes to
ConvHipImplicitGemmGroupBwdXdlops on 110 of 117.

Largest recoveries:

key before after speedup
128-7-7-5x5-32-7-7-512-2x2-1x1-1x1-0-NCHW-BF16-B GemmBwdRest 10.1070 ms 0.1859 ms 54.4x
340-1-1-3x3-256-1-1-256-1x1-1x1-1x1-0-NCHW-BF16-B GemmBwdRest 4.6086 ms 0.1060 ms 43.5x
340-1-1-3x3-256-1-1-200-1x1-1x1-1x1-0-NCHW-BF16-B GemmBwdRest 3.5753 ms 0.0930 ms 38.4x
1024-1-1-7x7-256-1-1-800-0x0-1x1-1x1-0-NCHW-BF16-B GemmBwdRest 33.9593 ms 1.4246 ms 23.8x

Not every shape improves. Replicate 1 showed 9 shapes below 0.95x and replicate 2 showed 8, but
only 2 are the same shape in both, so the rest is run to run variation on kernels that take under
0.1 ms. The two that persist are
512-7-7-3x3-512-7-7-15-1x1-1x1-1x1-0-NHWC-NHWC-NHWC-BF16-B and
340-3-3-3x3-256-3-3-4-1x1-1x1-1x1-0-NCHW-BF16-B, which together cost 0.0243 ms against 210.1 ms
saved across the set.

Test Plan

Build CK and MIOpen from the same checkout for gfx1201 and run the DBSync test on matching hardware.

test_db_sync --gtest_filter='*StaticFDBSync*'

Test Result

Run on a gfx1201 machine reporting 64 compute units, so MIOpen selects the
gfx120140 database under test.

source     ROCm/rocm-libraries e56d6561886b79500d814a3cc039ee477bf45f01
container  rocm/dev-ubuntu-22.04:7.14.1-full
CK         built from the same checkout and installed into /opt/rocm, so MIOpen binds the CK it
           was built against rather than the container's prebuilt copy
cmake      MIOPEN_TEST_DBSYNC=ON MIOPEN_TEST_DISCRETE=ON MIOPEN_USE_COMPOSABLEKERNEL=ON
           BUILD_DEV=OFF MIOPEN_INSTALL_GPU_DATABASES=gfx1201

Before, on the shipped database:

[       OK ] Smoke/CPU_DBSync_NONE.StaticFDBSync/11 (3944 ms)
exit=0   distinct invalid (fdb-key,solver): 0
MIOPEN_DBSYNC_CLEAN=1 -> oracle removals: 0

After, on the database in this PR:

[       OK ] Smoke/CPU_DBSync_NONE.StaticFDBSync/11 (3947 ms)
exit=0   distinct invalid (fdb-key,solver): 0
MIOPEN_DBSYNC_CLEAN=1 -> oracle removals: 0

The clean run leaves the files byte-identical, so MIOpen's own predicate accepts every entry this
PR adds.

Harness sensitivity was established with a negative control on the same build. Installing the
pre-#12088 database, whose decompressed sha256 are cf621424... for the find-db and
49a90431... for the perf-db exactly as #12088 recorded, gives:

[  FAILED  ] Smoke/CPU_DBSync_NONE.StaticFDBSync/11 (4009 ms)
distinct invalid (fdb-key,solver): 409
MIOPEN_DBSYNC_CLEAN=1 -> 409 removals, all ConvHipImplicitGemmGroupBwdXdlops

so the harness does detect bad rows, and the zero above is a real zero.

Content checks on the committed files:

  • pre-change tree content byte identical to develop (fdb f53cd455026861eb, pdb c3a5faab0d738cb5,
    first 16 hex of sha256 of the decompressed files)
  • post-change fdb 9bb2fac83c2d678a, pdb 046c3e66f88dca0a
  • exactly 117 find-db lines and 108 perf-db lines differ, each by exactly one added
    ConvHipImplicitGemmGroupBwdXdlops entry, and zero lines are removed
  • every new row was produced by MIOpen's own serializer during the restricted search
  • no surviving find-db entry for a tunable solver is left without a perf-db row, checked across all
    71955 tunable keys
  • bz2 round trip verified against the committed files

Submission Checklist

References

…lit-K cleanup

JIRA ID: ROCM-29026

#12088 removed 638 invalid CK entries from the gfx1201 system database. 169 of them were the
fastest recorded winner for their key. 117 of those are the split-K class, where the surviving
entry is usually GemmBwdRest and the recorded cost was a median 6.15x, worst 69.5x.

This re-tunes those 117 shapes on gfx1201 hardware and adds the resulting
ConvHipImplicitGemmGroupBwdXdlops entries back. Every perf config came from MIOpen's own
restricted search, every one carries kbatch 1, and every one was verified numerically against
the GPU reference. StaticFDBSync/11 passes on the updated database and MIOPEN_DBSYNC_CLEAN=1
removes nothing from it.
@yassinsolim
yassinsolim requested a review from a team as a code owner October 9, 2026 21:00
Copilot AI balanced review requested due to automatic review settings October 9, 2026 21:00

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.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

@therock-pr-bot

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

Copy link
Copy Markdown

⏳ Waiting on Required Checks

⏳ Required checks have not all concluded yet. This bot run is exiting without failing so those checks can report independently.

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 pre-commit ⏳ Pending ⏳ Still running…
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⏳ Required checks are still running or have not started yet.
This PR is not ready for review until they complete.

📖 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 9, 2026 •

Copy link
Copy Markdown

⏳ Waiting for required checks to start or finish:

  • ⏳ pre-commit

yassinsolim added a commit that referenced this pull request Oct 13, 2026
…rent gate no longer rejects (#13421)

Restore 228 of the 229 large-tensor CK entries #12088 removed from the gfx1201 system database
(165 backward-data, 63 forward find-db entries and 225 perf-db rows). Every restored line is
byte-identical to its pre-#12088 original; no lines are removed or newly written.

#12396 returned RequiresLargeTensorCKInstance to its backward-weight-only, element-count form once
#11754 gave CK its own per-instance overflow checks, so these forward and backward-data entries
resolve again. On gfx1201 the pre-#12088 database fails DBSync on 409 split-K entries only; the
split-K half is re-tuned separately in #13415. One entry stays out because it was slower.

Validated on an AMD Radeon AI PRO R9700 (gfx1201, 64 CU): StaticFDBSync and GPU-reference checks
pass for the base, this database and its union with #13415, and a paired MIOPEN_FIND_MODE=2 A/B
measured 1.43x aggregate kernel time across the 51 shapes these entries win (single run).

JIRA ID: ROCM-29026
#13421 restored large-tensor entries in the same gfx120140 find and perf databases this branch
re-tunes. Rebuild both as the key-level union: the two changes touch disjoint keys (228 and 117
find keys, 225 and 108 perf keys), every other line matches develop, and lines stay sorted.
The decompressed result matches the union validated natively on gfx1201 (find sha256 cb4d8f30,
perf sha256 061f9397).
@yassinsolim

yassinsolim commented Oct 14, 2026 •

Copy link
Copy Markdown
Member Author

@ROCm/miopen-reviewers could someone review this? It is a database-only change (gfx120140 find-db and perf-db) that restores the gfx1201 backward-data winners #12088 removed. pre-commit, Multi-Arch and Component CI are green.

Math CI Summary has been pending since Oct 13 23:00 UTC. The status comes from the rccl status gate (rocm-libraries/extra/rccl/PR-13415), which is waiting for component job statuses that have not been posted on this commit. Most other MIOpen PRs from the same day got SKIPPED BY MATH-CI, and #12933 and #12947 show the same pending gate. I don't know the cause. Could someone with Math CI access take a look?

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

LGTM

@yassinsolim
yassinsolim merged commit efb79d4 into develop Oct 20, 2026
106 checks passed
@yassinsolim
yassinsolim deleted the users/ysoliman/gfx1201-retune-splitk branch October 20, 2026 22:19
@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.

3 participants