Repository navigation
fix(miopen): drop invalid CK perf configs from the gfx1200 system database - #13420
Merged
Merged
Conversation
…abase Smoke/CPU_DBSync_NONE.StaticFDBSync/10 fails on gfx1200. 20 find-db entries name a ConvHipImplicitGemmGroupWrwXdlops CK instance that CK refuses to run, so TestPerfCfgParams rejects the stored perf config and the shape falls back to an untuned solver. All 20 are FP16 grouped backward-weights whose largest tensor holds between 2^30 and 2^31 elements. MIOpen's RequiresLargeTensorCKInstance counts elements and so leaves them on the regular int32-indexing instances, while CK's own tensor_exceeds_2gb guard (added by #11754) also tests the byte span and refuses those instances at 2^31 bytes. Every one of the 20 sits in that gap. Removal list produced by MIOPEN_DBSYNC_CLEAN=1 on gfx1200 hardware, not by hand. 20 find-db entries and 20 perf-db rows removed, nothing outside ConvHipImplicitGemmGroupWrwXdlops, and the test passes afterwards.
Contributor
There was a problem hiding this comment.
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.
⏳ Waiting on Required Checks⏳ Required checks have not all concluded yet. This bot run is exiting without failing so those checks can report independently.
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
⏳ Waiting for required checks to start or finish:
|
This was referenced Oct 9, 2026
Closed
iq136boy
approved these changes
Oct 12, 2026
Contributor
TheRock Submodule Bump ActivityNewest first
|
yassinsolim
added a commit
that referenced
this pull request
Oct 17, 2026
…#13373 (#13697) JIRA ID: ROCM-29026, ALMIOPEN-2090 Closes #13394. Two fixes to the gfx1200 system database (`gfx120020.HIP.fdb.txt.bz2`, `gfx120020.db.txt.bz2`), one commit each, plus a changelog commit: 1. Re-tune 8 and remove 3 of the 11 CK backward-weights rows that TheRock-built binaries reject (the part of #13394 that #13420 left). 2. Drop the 835 CK backward-weights entries that #13373 (merged Oct 14) invalidates. Before #13373, the configs behind them returned wrong weight gradients on gfx1200. They ship together because the database from part 1 alone fails `StaticFDBSync/10` with 835 invalid configs on any build that has #13373, which develop now does. ## Part 1: the 11 rows TheRock builds reject All 11 are `ConvHipImplicitGemmGroupWrwXdlops` entries whose stored instance has `split_k = -1` ("auto"). At runtime `MakeArgPtr` calls `GetMaxOccupancy()` (`hipOccupancyMaxActiveBlocksPerMultiprocessor`) on the live device, multiplies by the CU count, divides by the kernel's output grid size and picks `k_batch` from that (`get_best_occupancy_k_batch_value`, `split_k_utils.hpp:37`). `IsSupportedArgument` then accepts or refuses the derived `k_batch` depending on the instance's tile shape. Evidence for occupancy as the mechanism, and its limits: - #13420's analysis (prior art, not re-measured here) found TheRock CI artifacts reject 31 entries where a from-source build with the ROCm 7.14.1 toolchain rejects 20. That is a build-to-build pass/fail difference, not a measured occupancy difference. - An `LD_PRELOAD` interposer that forces a fixed value for every occupancy query, run against TheRock's own binaries, shows the failures follow the forced value: 0 of the 236 auto-split-K WRW rows fail at occupancy 1, and 1, 3, 3, 5, 6, 7, 9, 17, 28, 39 and 38 fail at 2, 3, 4, 5, 6, 8, 10, 12, 16, 24 and 32 (not strictly monotonic). Unforced, TheRock's build fails 11. - A run meant to compare the occupancy each build actually measures failed to start its container (`Unable to find group render`) and was not retried. "The two builds measure different occupancy" is the best-supported explanation, not a direct measurement. None of the 11 trips the large-tensor gate that #13419 is about. Each key was re-tuned on the TheRock build (`MIOPEN_FIND_MODE=1 MIOPEN_FIND_ENFORCE=4`, those 11 rows stripped from the system DB first) and each winner was re-run in a fresh process with `MIOpenDriver -V 1`: | key | re-tuned instance (+split_k) | verify | action | |---|---|---|---| | `1024-14-14-1x1-256-14-14-1024-...-BF16-W` | `Explicit_Xdl` | OK | kept | | `128-56-56-1x1-192-56-56-42-...-FP16-W` | `Explicit_Xdl` | OK | kept | | `256-28-28-1x1-512-28-28-1024-...-BF16-W` | `Explicit_Xdl` | OK | kept | | `352-7-7-3x3-352-14-14-10-...-FP16-W_g352` | `TwoStage_Xdl_CShuffle+1` | OK (forced) | kept | | `352-7-7-3x3-352-14-14-11-...-FP16-W_g352` | `TwoStage_Xdl_CShuffle+1` | OK (forced) | kept | | `352-7-7-3x3-352-14-14-22-...-FP16-W_g352` | `TwoStage_Xdl_CShuffle+1` | OK | kept | | `352-7-7-3x3-352-7-7-16-...-FP16-W_g352` | `TwoStage_Xdl_CShuffle+1` | OK | kept | | `512-1-1-1x1-512-1-1-1-...-BF16-W` | `Explicit_Xdl` | OK (forced) | kept | | `60-13-13-3x3-60-28-28-4-...-BF16-W` | `Xdl_CShuffleV3_WmmaPorted<64,64,32,32,...>+8` | **FAILED 0.88 > 0.13** | removed | | `64-28-28-7x1-64-28-28-1-...-BF16-W` | `Xdl_CShuffleV3_WmmaPorted<64,32,64,32,...>+-1` | **FAILED 0.84 > 0.13** | removed | | `64-28-28-7x1-64-28-28-1-...-FP16-W` | `Xdl_CShuffleV3_WmmaPorted<64,32,32,32,...>+8` | **FAILED 0.84 > 0.08** | removed | "Forced" rows: immediate-mode find never selects that key's CK entry on its own (a cheaper fallback wins), so the exact CK solver was forced with `MIOPEN_DEBUG_FIND_ONLY_SOLVER` (Slurm 68090048); all three verify (1.7e-5, 1.5e-5, 0). The three removed rows are the WMMA-ported V3 family that part 2 is about; #13373 rejects them too. Default find mode 2, TheRock build, median of 3 runs, RX 9060 XT, develop's database vs part 1: | key | develop (ms) | part 1 (ms) | ratio | |---|---|---|---| | 1024-...-BF16-W | 6.495 | 5.446 | 0.84x | | 128-...-FP16-W | 2.095 | 0.918 | 0.44x | | 256-...-BF16-W | 17.484 | 12.898 | 0.74x | | 352-...-10-...W_g352 | 0.087 | 0.099 | 1.13x | | 352-...-11-...W_g352 | 0.090 | 0.075 | 0.84x | | 352-...-22-...W_g352 | 0.147 | 0.115 | 0.78x | | 352-...-16-...W_g352 | 0.098 | 0.084 | 0.86x | | 512-...-BF16-W | 0.036 | 0.036 | 1.0x | | 60-...-BF16-W (removed) | 0.081 | 0.166 | 2.05x | | 64-...-BF16-W (removed) | 0.052 | 0.072 | 1.40x | | 64-...-FP16-W (removed) | 0.089 | 0.038 | 0.43x | Removing all 11 rows instead of re-tuning was tried and rejected: two keys then fall back to `GemmWrw1x1_stride1`, which fails verification on both (0.59 and 0.60 against 0.13, BF16 at N=1024). ## Part 2: the entries #13373 invalidates #13373 fixes `DeviceGroupedConvBwdWeight_Xdl_CShuffleV3::IsSupportedArgument`, which compared `num_k_loop` against the wave64 `PrefetchStages` on RDNA. Wave32 pipeline-V2 configs with too few K loops were accepted, the kernel returned without writing its output, and it finished far faster than the real work, so tuning ranked it first. Those configs are in this database. Scope: 1845 find-db records list `ConvHipImplicitGemmGroupWrwXdlops`; 844 resolve to a `DeviceGroupedConvBwdWeight_Xdl_CShuffleV3_WmmaPorted` perf config, and in 686 of those the CK entry is the fastest in the record, so find mode 2 picks it. Before #13373: all 686 were run on an RX 9060 XT with the TheRock main CI build of 24bdd07 (run 38489560586), one fresh MIOpenDriver process each, `-F 4 -t 1 -i 10 -V 1`. Forcing the solver and letting find mode 2 choose give the same verdict on every key: 680 wrong, 6 correct. Of the 680 failures, 674 have finite relative errors from 0.56 to 2.5e3 (median 0.91), 4 are NaN and 2 are above 1e30. With #13373: `StaticFDBSync/10` on the part 1 database, built from 24bdd07 plus only the #13373 diff, reports 835 invalid perf configs. That set contains all 680 measured-wrong keys and none of the 6 measured-correct ones; the other 155 sit in records where CK was not the fastest, so they were never measured. The committed files are the `MIOPEN_DBSYNC_CLEAN=1` output of that run: 835 solver entries leave the find-db, 826 perf-db records change, and the 435 of them that held no other solver are dropped. No find-db record is left empty. gfx120140 (gfx1201) has no CK backward-weights records and is untouched. ## Validation of this PR's database (parts 1 and 2 together) `Smoke/CPU_DBSync_NONE.StaticFDBSync/10` on `navi4x-hw-10` (Slurm 68091724): | check | build | database | result | |---|---|---|---| | negative control | 24bdd07 + #13373 | part 1 only | FAILED, 835 invalid perf configs | | cleanup | 24bdd07 + #13373, `MIOPEN_DBSYNC_CLEAN=1` | part 1 only | OK, 835 removals | | this PR | 24bdd07 + #13373 | this PR | OK, 0 failures | | this PR | 24bdd07, no #13373 | this PR | OK, 0 failures | | this PR | TheRock CI build 38489560586 | this PR | OK, 0 failures | The last row also covers part 1: develop's database fails 11 on that build. The committed bz2 files decompress to exactly the cleanup output (find-db sha256 `294a5eb5...`, perf-db `b159206a...`). Correctness after the change, #13373 build, default find mode 2, one fresh process per problem, `-V 1`, all 686 problems: 686 verify OK (Slurm 68091782). 680 move off CK (`GemmWrwUniversal` 486, `GemmWrw1x1_stride1` 63, `ConvWinoRageRxS` 41, Winograd variants 89, `TransposedConvBinWinoRxS` 1); the other 6 keep CK. All 63 `GemmWrw1x1_stride1` picks verify. Leaving the stale entries in place is not free once #13373 lands. The same run against the database without part 2 gave no wrong results, but 90 of the 529 problems it reached before its 6-hour limit hit the driver's 1200 s timeout. Against this PR's database all 686 problems finish, the slowest in 493 ms. ## What could break The 680 problems that move off CK are slower than the times recorded for the old entries: geomean 4.74x, median 3.69x, worst 4321x (0.11 ms to 493 ms). That is an upper bound, because the old kernel returned without computing the output, so its recorded time is the cost of a no-op. Re-tuning recovers most of it: on 12 stratified keys re-tuned with #13373, a valid CK config wins every time, all 12 verify, and they run a geomean 6.5x faster than the fallback (1.1x to 64.4x), at 4 to 16 s of search per key. Re-tuning all 835 entries is a follow-up; at that rate it is roughly 1 to 2 hours on one gfx1200 (estimate). ## Not in this PR - The re-tune of the 835 entries. - #13419 (element count vs byte span in `RequiresLargeTensorCKInstance`). - gfx1151 (`/9`) and gfx1102 (`/8`): their reported failures came from the pre-#12396 large-tensor gate and pass on current builds (GPU-free check); no database change. Related: #13305, #12942, #13373. ## Test plan ``` MIOPEN_SYSTEM_DB_PATH=<staged-dir> MIOPEN_USER_DB_PATH=<scratch> \ ./bin/miopen_gtest --gtest_filter='Smoke/CPU_DBSync_NONE.StaticFDBSync/10' ``` The branch was rebased onto develop after these runs; the database files are byte-identical to the validated ones, and develop has not changed them.
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA ID: ROCM-29026
Motivation
Smoke/CPU_DBSync_NONE.StaticFDBSync/10fails on gfx1200 (#13394). The gfx1200 systemdatabase was added by #10050 and has not been touched since. 20 of its find-db entries name a
CK instance that CK now refuses to run, so
TestPerfCfgParamsrejects the stored perf config,FindSolutionImpllogsInvalid config loaded from Perf Db, and the shape falls back to anuntuned solver.
#12088 did this cleanup for gfx1201. gfx1200 never got one.
Unlike gfx1201, gfx1200 has a single cause. All 20 are
ConvHipImplicitGemmGroupWrwXdlopsFP16 grouped backward-weights entries whose largest tensor holds between 2^30 and 2^31
elements, which puts them in the gap between MIOpen's large-tensor gate and CK's own overflow
guard:
RequiresLargeTensorCKInstance(src/ck_impl/implicitgemm_ck_util.hpp, as restoredby revert(miopen): partial revert of CK byte span gate for large instances #12396) counts elements and fires at 2^31. None of the 20 reaches it, so MIOpen keeps
offering the regular int32-indexing instances and the tuner recorded one of them.
tensor_exceeds_2gb(tensor_size_check.hpp, added by fix(ck): convolution edge cases large tensors #11754 on 2026-09-30) fires at2^31 elements or 2^31 bytes. For a 2-byte type the byte arm trips at 2^30 elements, so
all 20 do reach it. It sets
stride_overflowon the argument and the non-large-tensorinstance bails out of
IsSupportedArgument.The database predates #11754, which added this check. Before #11754, CK accepted these configs without testing for the overflow, so the tuner recorded them unflagged. That does not mean the earlier runs computed correct results for these shapes; #11754 exists precisely because unguarded int32 indexing can silently compute wrong results, which is the same risk #11585 and #12396 are about for the other directions.
The source-side gap is tracked separately in #13419; this PR only removes the rows that
can no longer resolve.
Technical Details
20 find-db entries and 20 perf-db rows removed. Both numbers are produced by
MIOPEN_DBSYNC_CLEAN=1, which is MIOpen's own predicate (solv.IsApplicablethensolv.TestPerfCfgParams), not a hand-built list.ConvHipImplicitGemmGroupWrwXdlopsNothing outside that solver is touched. By CK instance family:
DeviceGroupedConvBwdWeightTwoStage_Wmma_CShuffleV3DeviceGroupedConvBwdWeight_Wmma_CShuffleV3File deltas: the find database keeps all 90688 keys and changes 20 lines, each losing only the
unusable solver. The perf database goes from 77756 to 77736 lines, because for all 20 the CK
entry was the key's only perf-db row.
Why each entry fails, measured rather than inferred
An instrumented build was used to record, for every
IsCKArgsSupportedcall the test makes,whether MIOpen's gate fired, whether the stored instance was found, and which CK line rejected
it. Across all 40 failing checks (20 entries, each checked twice: once by
TestPerfCfgParamsand once by
FindSolution) the answer is identical:rlt=0:RequiresLargeTensorCKInstancereturned false on all 40.found=1: the recorded instance still exists in the registry on all 40. No entry failsbecause an instance was renamed or dropped.
large_ok=1: the large-tensor filter rejected nothing.supported=0: CK'sIsSupportedArgumentrefused, in all 40 at thearg.stride_overflowbranch, in
device_grouped_conv_bwd_weight_two_stage_wmma_cshuffle_v3.hpp:1180(24 checks)or
device_grouped_conv_bwd_weight_wmma_cshuffle_v3.hpp:1054(16 checks).So nothing here is a split-K problem, an LDS-size or
KPerBlock % KPerXdlrejection from#13079, or a
PrefetchStagesproblem (#13373). The whole set is the byte/element thresholdgap. Element spans run 1.10e9 to 2.11e9 and byte spans 2.21e9 to 4.12e9; every entry is FP16.
On the issue's count of 31
#13394 reports 31 failures. This PR removes 20. The other 11 are not removed here.
The 20 fail in every build tested: the from-source build above and TheRock's CI artifacts. The 11 (
DeviceGroupedConvBwdWeight_Explicit_Xdlx4,DeviceGroupedConvBwdWeightTwoStage_Xdl_CShufflex4,DeviceGroupedConvBwdWeight_Xdl_CShuffleV3_WmmaPortedx3) fail only in TheRock's build. On the same gfx1200 GPU with byte-identical database files, TheRock artifacts from run 37986471185 (rocm-libraries3ecaa6512fb, no per-target CK changes) and from run 37986476054 (per-target cutover) both fail the same 31 with a byte-identical gfx1200 CK plugin, while the source build fails 20. So the 11 come from the TheRock-built binaries. The cause is not isolated yet; #13394 has the details.An earlier version of this description attributed the 11 to the per-target CK branch. That was wrong.
Consequence: after this PR, TheRock's gfx1200
StaticFDBSync/10still fails on those 11 until they are resolved.Performance consequence
16 of the 20 removed entries were the fastest recorded winner for their key. No key loses its
last entry, so there is no fallback to a runtime find.
For those 16 the next best entry is a median 1.34x slower and at worst 1.84x. The worst case is
64-222-222-3x3-3-224-224-512-0x0-1x1-1x1-0-NCHW-FP16-W, which goes fromConvHipImplicitGemmGroupWrwXdlopsat 50.6900 ms toGemmWrwUniversalat 93.5055 ms. The newfastest solver is
GemmWrwUniversalin all 16 cases.None of this is recoverable by re-tuning as the code stands: CK refuses the regular instances
for these shapes, and MIOpen's gate does not route them to a large-tensor instance either, so a
fresh tuning run on gfx1200 would record the same unusable configs again. Closing that is what
#13419 is for.
Test Plan
Build CK and MIOpen from one checkout for gfx1200 and run the DBSync test on gfx1200 hardware.
Test Result
Before, against the exact blobs of the commit under test:
Oracle pass,
MIOPEN_DBSYNC_CLEAN=1:After, with the cleaned files bz2-compressed and decompressed again, exactly as committed:
Content checks on the committed files:
ab5e514b728496d9(find-db) and
2c94d6a19418a233(perf-db), the same blobs as at3ecaa6512fband at thecurrent develop head
MIOPEN_DBSYNC_CLEAN=1, so it is MIOpen's own predicateConvHipImplicitGemmGroupWrwXdlops, zero outside itPDB entry does not exist for tunablefailure, so nosurviving tunable find-db entry was left without its perf-db row
Submission Checklist