Skip to content

[AIROCMLIR-888] Implement per-problem narrowing in the quick-tuning DB#2361

Open
mirza-halilcevic wants to merge 24 commits into
developfrom
quick-tune-prob-map
Open

[AIROCMLIR-888] Implement per-problem narrowing in the quick-tuning DB#2361
mirza-halilcevic wants to merge 24 commits into
developfrom
quick-tune-prob-map

Conversation

@mirza-halilcevic

@mirza-halilcevic mirza-halilcevic commented May 4, 2026

Copy link
Copy Markdown
Contributor

Motivation

Quick-tuning compile time was dominated by the size of the perfconfig list we swept for each kernel. We previously sent the entire per-(arch, op, dtype) set-cover at every kernel, even when the problem at hand was already represented in our tuning campaigns and a much smaller subset would have sufficed.

This PR addresses that on two fronts:

  • Known problems: tier-1 problems we have tuning data for now carry an explicit problem → perfconfig-subset mapping. The compiler narrows the sweep to just the configs that cover this exact shape, instead of the full set.
  • Unknown problems: the returned list is capped with a new env var, ROCMLIR_QUICK_TUNING_LIST_MAX (default 30). The set-cover is already sorted by descending coverage count, so head-truncating preserves the configs that win on the most problems; statistically the right tradeoff when we have no problem-specific signal.

The branch also lands a few quality-of-life cleanups around the quick-tuning plumbing that were prerequisites for the per-problem mapping.

The existing quick-tune lists were migrated to the new per-key .inc format in this PR; the migration carries the set-covers only and does not include problem maps. Regenerating the lists with problem maps populated will land in a follow-up. Until then, all entries take the unknown-problem path (full set-cover, capped to ROCMLIR_QUICK_TUNING_LIST_MAX).

Note on diff size: the diff is inflated by the ParamLookupTable → QuickTuningDb rename and by the migration of the existing perfconfig data from one monolithic .inc into per-key .inc files. The hand-written code change is significantly smaller than the line count suggests.

Technical Details

Quick-tuning DB layout

  • One .inc file per (arch, op, dtype) key (mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942ConvF16.inc, etc.). The previous monolithic QuickTuningPerfconfigs.inc is gone. CMake globs the per-key files in sorted order and generates a single QuickTuningDb.inc that the lookup TU includes twice (once with QUICK_TUNING_DB_ARRAYS to emit the static arrays, once with QUICK_TUNING_DB_ENTRIES to emit the table initializer). Sorted filenames ↔ sorted snake_case keys, which is the precondition the binary-search lookup relies on.
  • ParamLookupTableQuickTuningDb, restructured from a class into a namespace. The semantics (lookup-by-key with arch-family fallback) are now closer to a curated database than a generic param table, and the new name reflects that. Private helpers moved into anonymous namespaces in the cpp.
  • quickTuningGen.py auto-detects op type from the input .debug headers (Chip column for arch, dataframe columns for op). One invocation now handles a mixed bag of gemm/conv/attention runs without per-op flags.

The problem map

Each table entry has the shape:

struct QuickTuningDbEntry {
  const char *key;                   // e.g. "gfx942_conv_f16"
  const StringRef *setCover; ...;    // full set-cover (sorted by coverage desc)
  const unsigned *indices;   ...;    // flat run of indices into setCover
  const ProblemRef *problemMap; ...; // sorted by hash
};

struct ProblemRef { uint64_t hash; unsigned offset, count; };

A ProblemRef is a (hash, offset, count) triple. To answer "what configs should we sweep for this problem?" we:

  1. Compute the problem-key hash for the op (see below).
  2. Resolve the table entry for (arch, op, dtype, isAccel) via binary-search with arch-family fallback (e.g. gfx940 → gfx942, bf16 → f16).
  3. Binary-search problemMap for the hash. On hit, take indices[offset .. offset+count) and gather those positions out of setCover. On miss, fall back to the full set-cover.
  4. Truncate to ROCMLIR_QUICK_TUNING_LIST_MAX (default 30).

The flat-indices layout means a single .inc carries one set-cover plus a compact per-problem index ribbon; no duplicated config strings, no per-problem allocations.

Problem keys

The on-disk hashes are xxh3_64 of a '_'-joined column tuple. Python is the authoritative producer (quickTuningGen.py:make_problem_key / hash_problem_key); C++ rebuilds the same byte sequence at runtime so the hashes line up:

  • Bool columns are coerced to int at DataFrame ingest, so the wire format is 0/1 (was True/False). C++ mirrors this in QuickTuningProblemKey.cpp.
  • Per-op column lists are pinned to the *_COLUMNS constants in the generator (GEMM_COLUMNS, CONV_COLUMNS, ATTENTION_COLUMNS).
  • Goldens are pinned in both mlir/utils/performance/tests/test_quickTuningGen.py and mlir/unittests/Dialect/Rock/QuickTuningDbTests.cpp. Drift on either side fails both suites.

Wiring on the consumer side

  • PopulateParamsInfo carries an optional problemKeyHash, populated via QuickTuningDb::computeProblemKeyHash(op) (returns FailureOr<uint64_t>).
  • PopulateParams, PopulateParamsXDL, PopulateParamsWmma, and PopulateParamsGemmGemm thread the hash into QuickTuningDb::lookup.
  • RockTuningImpl::createGemmTuningRangeQuick does the same in the tuning sweep, so tuning runs also benefit from the narrowing.

Test Plan

  • New gtest suite QuickTuningDbTests covers DB invariants (sorted by key, per-entry problem maps sorted by hash), resolveKey fallback policy (exact / older-relative / younger-relative / equidistant tiebreak / non-accel → gfx1*+f32 / bf16f16), and per-op problem-key goldens for gemm/conv/attention.
  • New pytest module test_quickTuningGen.py covers make_problem_key format, the bool-cast at ingest, and golden hashes shared with the C++ side.

Test Result

Submission Checklist

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.

Pull request overview

This PR restructures Rock’s quick-tuning “DB” into a curated QuickTuningDb with optional per-problem narrowing (via a problem-key hash) and a configurable cap (ROCMLIR_QUICK_TUNING_LIST_MAX) to reduce compile-time spent sweeping large perfconfig lists.

Changes:

  • Introduces QuickTuningDb + runtime problem-key hashing (xxh3_64) to optionally narrow perfconfig sweeps to a per-problem subset.
  • Threads an optional problemKeyHash through quick-tuning plumbing so both compile-time selection and tuning sweeps can benefit.
  • Migrates the perfconfig data into per-(arch, op, dtype) auto-generated .inc shards, and adds C++/Python goldens + DB invariant tests.

Reviewed changes

Copilot reviewed 121 out of 122 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
mlir/utils/performance/tests/test_quickTuningGen.py Adds pytest goldens for problem-key formatting, bool-cast behavior at ingest, and pinned xxh3_64 hashes.
mlir/unittests/Dialect/Rock/ParamLookupTableTests.cpp Removes legacy ParamLookupTable fallback-policy tests (superseded by QuickTuningDb tests).
mlir/unittests/Dialect/Rock/CMakeLists.txt Switches unit tests to QuickTuningDbTests.cpp and adds MLIRParser for parsing MLIR test snippets.
mlir/unittests/Dialect/Rock/QuickTuningDbTests.cpp Adds gtests for DB invariants, resolveKey fallback policy, and problem-key hash goldens.
mlir/lib/Dialect/Rock/Tuning/RockTuningImpl.cpp Threads problemKeyHash into quick tuning range creation so tuning sweeps can narrow lists too.
mlir/lib/Dialect/Rock/Tuning/GridwiseGemmParams.cpp Populates PopulateParamsInfo::problemKeyHash from the op (when computable).
mlir/lib/Dialect/Rock/Tuning/GridwiseGemmGemmParams.cpp Switches GemmGemm quick-tuning lookup to QuickTuningDb and computes optional problem hash.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb.cpp Implements key resolution + lookup (including per-problem selection + list cap).
mlir/lib/Dialect/Rock/Tuning/QuickTuningProblemKey.cpp Implements op→problem-key string formatting and xxh3_64 hashing to match Python generator.
mlir/lib/Dialect/Rock/Tuning/CMakeLists.txt Replaces ParamLookupTable sources with QuickTuningDb sources; generates QuickTuningDb.inc by globbing/sorting per-key .inc files.
mlir/lib/Dialect/Rock/Tuning/ParamLookupTable.cpp Removes legacy ParamLookupTable implementation.
mlir/include/mlir/Dialect/Rock/Tuning/QuickTuningDb.h Adds the public QuickTuningDb API (lookup/resolveKey/problem hashing + invariants for tests).
mlir/include/mlir/Dialect/Rock/Tuning/ParamLookupTable.h Removes legacy ParamLookupTable API.
mlir/include/mlir/Dialect/Rock/Tuning/QuickTuningPerfconfigs.inc Removes the previous monolithic quick-tuning perfconfig include.
mlir/include/mlir/Dialect/Rock/Tuning/GridwiseGemmParams.h Switches tuning parameter plumbing to QuickTuningDb and adds problemKeyHash to PopulateParamsInfo.
mlir/include/mlir/Dialect/Rock/Tuning/GridwiseGemmGemmParams.h Switches GemmGemm tuning to QuickTuningDb.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000ConvFp8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000GemmFp8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1000GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1100ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1100ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1100ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1100GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1100GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1100GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1101AttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1101AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1101AttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103AttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103AttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1103GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150AttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150AttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1150GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1151ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1151ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1151ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1151GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1151GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1151GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152AttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152AttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1152GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201AttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201AttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx1201GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx900AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx900AttentionF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx900ConvFp8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx900GemmFp8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908AttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908AttentionF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908AttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx908GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aAttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aAttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aAttentionF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aAttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aGemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aGemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx90aGemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942AttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942AttentionF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942AttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx942GemmI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950AttentionBf16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950AttentionF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950AttentionF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950AttentionI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950ConvF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950ConvF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950ConvI8.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950GemmF16.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950GemmF32.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950GemmFp4.inc Auto-generated per-key set-cover shard.
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb/Gfx950GemmI8.inc Auto-generated per-key set-cover shard.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mlir/lib/Dialect/Rock/Tuning/QuickTuningDb.cpp Outdated
@mirza-halilcevic
mirza-halilcevic marked this pull request as ready for review May 11, 2026 13:46
@mirza-halilcevic
mirza-halilcevic requested a review from causten as a code owner May 11, 2026 13:46
@mirza-halilcevic mirza-halilcevic changed the title [AIROCMLIR-560] Implement per-problem narrowing in the quick-tuning DB [AIROCMLIR-888] Implement per-problem narrowing in the quick-tuning DB May 19, 2026
@mirza-halilcevic mirza-halilcevic added the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 1, 2026
@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot removed the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 1, 2026
@mirza-halilcevic mirza-halilcevic added the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 1, 2026
@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot removed the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 1, 2026
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.71429% with 64 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb.cpp 74.74% 35 Missing and 13 partials ⚠️
.../lib/Dialect/Rock/Tuning/QuickTuningProblemKey.cpp 88.28% 5 Missing and 10 partials ⚠️
...lib/Dialect/Rock/Tuning/GridwiseGemmGemmParams.cpp 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2361      +/-   ##
===========================================
+ Coverage    82.57%   82.66%   +0.09%     
===========================================
  Files          120      119       -1     
  Lines        42852    43025     +173     
  Branches      7110     7152      +42     
===========================================
+ Hits         35381    35563     +182     
- Misses        4815     4823       +8     
+ Partials      2656     2639      -17     
Flag Coverage Δ
gfx120x 82.51% <81.43%> (-0.02%) ⬇️
gfx950 82.50% <81.43%> (+0.15%) ⬆️
mfma 82.40% <81.14%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...lude/mlir/Dialect/Rock/Tuning/GridwiseGemmParams.h 100.00% <ø> (+4.76%) ⬆️
...lir/lib/Dialect/Rock/Tuning/GridwiseGemmParams.cpp 77.08% <100.00%> (+1.05%) ⬆️
mlir/lib/Dialect/Rock/Tuning/RockTuningImpl.cpp 59.41% <100.00%> (+0.09%) ⬆️
...lib/Dialect/Rock/Tuning/GridwiseGemmGemmParams.cpp 88.51% <87.50%> (-0.52%) ⬇️
.../lib/Dialect/Rock/Tuning/QuickTuningProblemKey.cpp 88.28% <88.28%> (ø)
mlir/lib/Dialect/Rock/Tuning/QuickTuningDb.cpp 74.74% <74.74%> (ø)

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mirza-halilcevic mirza-halilcevic added the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 3, 2026
@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot removed the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 3, 2026
@mirza-halilcevic mirza-halilcevic added the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 16, 2026
@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot removed the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 16, 2026
@mirza-halilcevic mirza-halilcevic added the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 16, 2026

@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE -- submitted as COMMENT (automated reviews are advisory)  ·  Findings: 0 (0 Critical, 0 Major, 0 Minor)


Scope

Reworks the quick-tuning database: renames ParamLookupTableQuickTuningDb (class → namespace), splits the monolithic QuickTuningPerfconfigs.inc into per-(arch,op,dtype) .inc files globbed+sorted by CMake, adds a per-problem narrowing path (xxh3_64 problem-key hashing mirrored between quickTuningGen.py and QuickTuningProblemKey.cpp), and caps results via ROCMLIR_QUICK_TUNING_LIST_MAX (default 30). Consumer wiring threads an optional problemKeyHash through PopulateParams* and RockTuningImpl. Bulk of the diff is migrated/auto-generated data plus the rename.

Findings

No blocking issues found. The one prior inline comment (Copilot: std::mismatch 3-iterator overload reading past itKey/prevKey end) is already addressed — QuickTuningDb.cpp now uses the bounded 4-iterator overload at both call sites.

Notes

  • Non-accel fallback now restricted to gfx1*. getRelatives forces archPrefix="gfx1" and f32 when !isAccel (QuickTuningDb.cpp), whereas the old ParamLookupTable used a 3-char gfx prefix (any family). This is intentional and covered by ResolveKeyTest.NonAccelRestrictsToGfx1Family, but it is a behavior change: a non-accel f32 query on a non-MFMA gfx9 part (e.g. gfx900, which has no *GemmF32/*ConvF32 data here) now resolves to a gfx1* entry rather than the nearest gfx9 sibling. Worth a sanity check that no supported flow regresses; configs remain valid (vetted by paramsProbablyValid), so worst case is sub-optimal, not incorrect.
  • Conv problem-key for grouped/asymmetric cases. makeConvKey encodes C as in[ci]*in[gi], K as fil[k]*fil[g], and padding as pad[0]/pad[2] only. Goldens only exercise G=1 and symmetric padding=1; when problem maps are populated in the follow-up, extend goldens to G>1 / asymmetric padding to confirm byte-parity with the Python C/PaddingH/PaddingW columns. No current effect since the migrated data carries no problem maps (all queries take the full set-cover path).
  • Minor/non-blocking: lookup() calls normalizeArch and then resolveEntry normalizes again (idempotent); pip_requirements.txt correctly gains pulp/xxhash; new files carry the correct Part of the MLIR Project SPDX header.

CI status

No genuine CI failures. Jenkins, C/C++ premerge, Python format/lint, and Python performance script tests all pass; many hardware jobs are still pending. The failing review check is this auto-review pipeline's own job and is expected.

@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot removed the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants