Skip to content

Run verify tests across all supported compile modes per target - #5357

Open
pfultz2 wants to merge 5 commits into
developfrom
verify-compile-modes
Open

pfultz2 wants to merge 5 commits into
developfrom
verify-compile-modes

Conversation

@pfultz2

@pfultz2 pfultz2 commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Motivation

The verify suite registered every program twice, once as test_name (balanced) and once as test_name_eager, which doubled the test count and ran the ref target twice per program. The compile mode is a per-target property, so the harness should decide which modes to exercise rather than the test registration. This also gives compile_modes a proper name mapping so results and logs can print the mode instead of hand-maintained switch statements.

Technical Details

  • target_info gains a compile_modes vector (default {balanced}), and run_verify::set_compile_modes_for(name, modes) configures it. main.cpp sets the GPU target to {eager, balanced}, since it is the only target that reads compile_options::compile_mode.
  • run_verify::verify runs the ref target once, then compiles and runs each target under every supported mode, comparing all against the same ref results. Result labels are target(mode), e.g. gpu(eager), so failures identify the mode.
  • The _eager duplicate test cases are removed from run_verify::run.
  • compile_modes is now declared with MIGRAPHX_ENUM_CLASS, providing to_string, operator<<, from_string, and enum_entries automatically. convert_to_compile_mode uses enum_entries instead of a hand-written mode array and string comparison chain; the case-insensitive and integer fallback behavior is unchanged.

Changelog Category

Add a CHANGELOG.md entry for any option other than Not Applicable

    • Added: New functionality.
    • Changed: Changes to existing functionality.
    • Removed: Functionality or support that has been removed. (Compared to a previous release)
    • Optimized: Component performance that has been optimized or improved.
    • Resolved Issues: Known issues from a previous version that have been resolved.
    • Not Applicable: This PR is not to be included in the changelog.

Follow the LLVM AI Tool Use Policy for contributions using AI.

@pfultz2
pfultz2 requested a review from causten as a code owner October 6, 2026 23:23
@pfultz2
pfultz2 requested review from pnikolic-amd and a balanced review from Copilot October 6, 2026 23:23

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 review overview

🟡 Changes recommended

Concurrent GPU mode tasks race while updating the shared auto_print handler.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity

Open (3)
What changed in this PR

Consolidates verify-suite compile modes per target while reusing one reference result.

Changes:

  • Runs GPU verification in eager and balanced modes.
  • Removes duplicate _eager test registrations.
  • Adds generated enum name conversion helpers.

Review performed as a single pass without agent fan-out.

File Description
test/​verify/​run_verify.hpp Adds per-target compile modes.
test/​verify/​run_verify.cpp Executes modes against one reference result.
test/​verify/​main.cpp Configures GPU modes.
src/​include/​migraphx/​compile_modes.hpp Converts the enum to MIGRAPHX_ENUM_CLASS.
src/​compile_modes.cpp Uses generated enum entries and names.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +228 to +230
results.emplace_back(
tname + "(" + to_string(mode) + ")",
detach_async([=] { return run_target(t, p, m, mode_opts); }, ti.parallel));
balanced = 50,
max = 100
};
MIGRAPHX_ENUM_CLASS(compile_modes, eager = 0, balanced = 50, max = 100)
Comment on lines +228 to +230
results.emplace_back(
tname + "(" + to_string(mode) + ")",
detach_async([=] { return run_target(t, p, m, mode_opts); }, ti.parallel));
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5357      +/-   ##
===========================================
+ Coverage    92.68%   92.72%   +0.04%     
===========================================
  Files          633      636       +3     
  Lines        36092    36207     +115     
===========================================
+ Hits         33450    33570     +120     
+ Misses        2642     2637       -5     
Files with missing lines Coverage Δ
src/compile_modes.cpp 100.00% <100.00%> (ø)
src/include/migraphx/compile_modes.hpp 100.00% <100.00%> (ø)

... and 19 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.

This branch has not been deployed

No deployments
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.

3 participants