Repository navigation
feat(miopen): Fix system-DB fallback so MI308 (gfx942) resolves to a usable DB - #8802
Merged
Merged
Conversation
…e DB Two issues prevented gfx942 parts without their own system database from falling back correctly: 1. The inexact (closest-CU) search built its candidate list with fs::path::extension(), which returns only the final ".txt" component and so never matched the multi-dot ".fdb.txt"/".db.txt" names. The candidate list was always empty on disk-based text DBs, so no fallback DB was ever selected. Exact-match devices were unaffected (they hit fs::exists), which hid the bug from every device that ships its own DB. Switch the filter to EndsWith on the full filename in the find-db and perf-db loops (embedded and on-disk). 2. Add GetSysDbSelectionCu(): low-CU gfx942 parts have no dedicated system DB and would otherwise land on the nearer-by-count sibling. Bias their selection to the higher-CU gfx942 database instead. System-DB selection only; user DBs keep the device's own basename, so per-device tuned data is still read and written separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
Covers the low-CU gfx942 (MI308) system-DB redirect: threshold boundary at 80 CUs, high-CU passthrough (228/304), non-gfx942 passthrough, and empty db_id handling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jdcampbe
enabled auto-merge (squash)
August 24, 2026 22:30
JonathanLichtnerAMD
added a commit
that referenced
this pull request
Sep 2, 2026
## Summary Backfills the **MIOpen 3.6.1 / ROCm 10.1.0** changelog section with externally-visible changes that landed since the `release/therock-10.0` branch but weren't yet documented. All 43 MIOpen commits in that range were reviewed; CI/build-infra, test-only, docs, version-bump, and already-documented changes were excluded. 21 entries added: ### Added * [RNN] Fused single-layer LSTM forward-inference kernel, gated behind `MIOPEN_DEBUG_RNN_FUSED_INFERENCE` (#8915) * [Conv] Naive reference kernel enabling 3D INT8 forward convolution (#10051) * [Conv] `ConvHipConv` solver backed by vendored hipconv kernels (#9746) * [Conv] float8 vector type support + deduplicated math kernels (#10130) * [Conv] Validated gfx1151 and gfx1200 (Navi) SystemDBs (#10050) * [Conv] `MIOPEN_DEBUG_DISABLE_SYSTEM_DB` / `MIOPEN_DEBUG_DISABLE_USER_DB` env vars (#10728) * [Conv] CK depthwise convolution on RDNA wave32 GPUs (#9373) ### Changed * [Conv] Winograd Rage RxS f2x3 on gfx950 + gfx942 v4_6_1/v4_9_1 kernels (#9014) * [Conv] Updated 3D AI heuristics for gfx942 & gfx950 (#8954) ### Optimized * [Conv] Single GEMM for point (1x1) output convolution, all directions, 2D/3D (#10912) * [Conv] Naive backward-data kernel work group widened to 1024 (#10684) ### Resolved Issues * [Conv] Batch-split miscalculation on large WrW tensors — ROCM-26011 (#11188) * [Conv] Conv failure on XNACK-unsupported gfx9 APUs (gfx90c) (#11211) * [BatchNorm] Device heap-overflow in fwd spatial `FinalMeanVariance` — ALMIOPEN-2424 (#11093) * [Conv] Deterministic `SetNextValue` polarity for grouped Bwd/Wrw CK solvers (#10240) * [LRN][LayerNorm] Grid alignment + OOB threads on gfx1250 (#10251) * [Conv] Stale gfx950 grouped-wrw SystemDB entries (#11130) * [Conv][Windows] System-DB path resolution from the MIOpen module (#10838) * [Conv] System-DB fallback so MI308X (gfx942) resolves a usable DB (#8802) * JSON perf logs (`MIOPEN_PERFORMANCE_LOGS`) dropping the last solver during Find (#11166) * Build failure against GCC 15 libstdc++ under C++20 (#9642) ## Notes Deliberately excluded: internal/default-off changes (#10219, #10088, #10649, #10231), a near-duplicate of an existing 10.0.0 entry (#10188), and CI/build-infra/test-only/docs commits. Docs-only change; no code impact. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.
Motivation
gfx942 encompasses multiple cards. The current system dbs don't cover all of the cards due to inexact ("closest compute-unit") fallback silently selected nothing, so MIOpen ran with no system tuning data and logged
File is unreadable: ".../miopen_system_db/gfx942_64.HIP.fdb.txt". This PR fixes the root-cause bug that left the fallback's candidate list empty, and adds a small, scoped redirect so such parts fall back to the appropriate sibling gfx942 database (gfx942130) instead of the nearer-by-count but less suitablegfx942e4.JIRA ID : ALMIOPEN-2121
Technical Details
System DBs are named an exact base naming system. When the exact basename file is absent, MIOpen runs an inexact search: scan the DB directory and pick the file for the same arch (
DbId) with the numerically closest CU count.Root-cause bug. The inexact search built its candidate list with
fs::path::extension():std::filesystem::path::extension()returns only the final component after the last dot —.txtforgfx942e4.HIP.fdb.txt— so it can never equal the multi-dot.fdb.txt/.db.txt. On disk-based text DBs (every shipped DB) the candidate list was always empty, the inexact search returned an empty path, and no fallback DB was loaded. This was invisible on devices that ship their own DB because they short-circuit on the exact-matchfs::exists()path, which never touches this filter.Fix 1 — candidate collection. Match against the full filename with
EndsWith(...)instead ofextension(), in all four inexact loops:src/find_db.cpp:163(find-db, on-disk) and the embedded find-db loop (already usedEndsWith, left as is atsrc/find_db.cpp:83).src/include/miopen/execution_context.hpp:230(perf-db, on-disk) and:153(perf-db, embedded); added#include <miopen/stringutils.hpp>.Fix 2 — scoped sibling redirect. Add
GetSysDbSelectionCu()insrc/include/miopen/handle.hpp:Intentionally not changed. User DBs (
*.udb.txt/*.ufdb.txt) keep the device's own basename and have no inexact fallback, so per-device tuned data is still read and written separately. The exact-match path is untouched — devices with their own DB short-circuit before any modified code runs.GetSysDbSelectionCureturns the real CU count unchanged for every other arch and for gfx942 parts above the threshold. The kdb path (arch-only fallback) is unaffected.Test Plan
Build a multi-arch image from this branch and run a small smoke set (conv fwd/bwd/wrw x fp32/fp16/bf16) with
MIOPEN_LOG_LEVEL=7(to capture DB resolution) andMIOPEN_FIND_MODE=2, across:For each, inspect the shard log for the find-db / perf-db resolution lines and confirm:
Found exact ... database filefor exact parts;inexact find database searchthenFindRecord ... in file ".../<expected>"for the fallback part.File is unreadableon amiopen_system_dbpath.Test Result
unreadable?gfx942130gfx942130gfx942130gfx942130gfx950100gfx950100The fallback part now logs
inexact find database search, thenFindRecord ... in file ".../gfx942130.HIP.fdb.txt", and the perf-db opensgfx942130.db.txt(the transientgfx942e4"best candidate" line is superseded bygfx942130at distance 0 from the biased target; onlygfx942130is actually opened). NoFile is unreadableon the system DB. Exact-match parts logFound exact ... database fileand load their own DBs unchanged. Two additional same-DB sanity runs on a second node each (mi300x/mi325x and gfx950) are still in progress and are expected to match the corresponding sanity rows; will update if anything differs.Risk Assessment
Risk level: Low
src/find_db.cpp,src/include/miopen/execution_context.hpp,src/include/miopen/handle.hpp(3 files, +40 / -11). Affects only the inexact ("closest-CU") fallback branch. Not touched: the exact-match path, user DBs, the kdb path, public API/ABI, kernels, and any non-gfx942 arch.gfx942130rather thangfx942e4or nothing. No behavior change for any device that already resolved a DB.fs::exists()before the modified code).MIOPEN_LOG_LEVEL=7(see Test Plan); validated on real gfx942 and gfx950 hardware.Submission Checklist