Repository navigation
feat(hipdnn-integration-tests): add --benchmark timing for verified graphs - #13915
Merged
SamuelReeder merged 7 commits intoOct 27, 2026
Merged
Conversation
…raphs Add an opt-in --benchmark mode to hipdnn_integration_tests. After a bundle or C++ graph test verifies the engine output, the harness runs the same plan on the same tensors again and times it with Graph::execute_timed_ext(). Each timed test prints min/median/mean device time, the engine and the timing quality, and records them as benchmark_* gtest properties. --benchmark-iterations and --benchmark-warmup set the sample and warmup counts. Combinations that do not execute the graph are refused. Closes #11652
✅ 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. |
Rename three test cases that the test name validator rejects. Run the bundle harness benchmark tests over AUTO with golden data, AUTO with the reference oracle chain, and GOLDEN mode, so each benchmark hook has a unit test. Move the plan workspace allocation into allocatePlanWorkspace(), shared by execute() and the benchmark. Document which tests are not timed.
…tune Replace the hand-written timing loop, statistics and engine-name lookup with Graph::autotune() limited to the engine under test (FIXED_AVERAGE, the --benchmark warmup and iteration counts). The benchmark now uses the same stall-gate restart, retry budget and statistics as autotune, and reports min, robust, mean and stddev from AutotuneResult.
Each test starts with an idle GPU. With 1-10 warmup executions the MI210 quick-tier bundles read 4-60% slow against a 200-iteration reference; with 30 they settle within about 1-2%. More timed iterations do not remove the bias.
…ned solution Add tuned=0|1 to the [ BENCHMARK ] line and a benchmark_tuned gtest property. tuned=1 only when HIPDNN_FORCE_BENCHMARKING is on and the engine exposes the global.benchmarking knob; the harness sets no knobs, so the default is the engine's heuristic choice.
adickin-amd
reviewed
Oct 20, 2026
adickin-amd
reviewed
Oct 20, 2026
adickin-amd
reviewed
Oct 20, 2026
adickin-amd
reviewed
Oct 20, 2026
adickin-amd
reviewed
Oct 20, 2026
adickin-amd
reviewed
Oct 20, 2026
adickin-amd
approved these changes
Oct 20, 2026
adickin-amd
left a comment
Contributor
There was a problem hiding this comment.
few small nitpicks, lgtm otherwise
CMiservaAMD
reviewed
Oct 20, 2026
CMiservaAMD
left a comment
Contributor
There was a problem hiding this comment.
LGTM overall, just the one thought on exposing RUN_UNTIL_STABLE as an alternative optional strategy.
- Catch exceptions from the benchmark in benchmarkIfVerified() so a throw fails the test without replacing the verified outcome. - Move the result pick into selectEngineResult() and unit-test it. - Move reportBenchmark() and toString(TimingQuality) to BenchmarkReport.hpp and currentTestName() to CurrentTestName.hpp; reuse currentTestName() in the report. - toString(TimingQuality) throws on an unknown value. - executeGpuGraph() uses allocatePlanWorkspace(). - Make the docs example match its sample output.
SamuelReeder
deleted the
users/sareeder/hipdnn-integration-perf-driver
branch
October 27, 2026 05:16
Contributor
TheRock Submodule Bump ActivityNewest first
|
adickin-amd
added a commit
that referenced
this pull request
Oct 30, 2026
Brings in the SDPA backward O/LSE derivation (#14312), the cuDNN left-bound semantics (#14483), the SDPA kernarg range checks (#14075) and --benchmark (#13915). Conflicts: the outcome publishing moved into runBody() on this branch, so the benchmark report now sits there; TestFillInputs and the docs keep both sides.
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.
Summary
Add an opt-in
--benchmarkmode tohipdnn_integration_tests. Each bundle or C++ graph test that verifies the engine output is then timed on the same engine and tensors withGraph::autotune()(STANDARDmode). This gives a C++ accuracy-plus-performance driver for bundled shapes and custom graphs, as requested in #11652, without a new binary or a second timing implementation.JIRA ID : #11652
Closes #11652
Risk Assessment
Risk level 2. The base rubric puts new feature paths and test infrastructure at level 3. This PR is at level 2 because
--benchmarkis off by default, so no CI lane or default run executes the new timing path. The change is limited to the integration-test harness underdnn-providers/integration-tests/. Without--benchmark, the only behavior changes are a restructure ofrunReferenceMode()that keeps the same oracle order, and the move of the workspace allocation inFrontendGraphEngineRunner::execute()into a shared helper. Unit tests cover both for AUTO with golden data, AUTO with the reference chain, and GOLDEN mode. The hipDNN library, the providers and the plugin ABI do not change. Timing reuses the publicGraph::autotune(), limited to the engine under test, so the stall gate from #11813, the retries and the statistics are autotune's own.ASIC Coverage
Host-side harness code only. No kernel, dispatch, default or support-surface change. Standard PR CI is sufficient. The timed path was exercised locally on gfx90a (MI210) with the MIOpen and hipBLASLt providers.
Testing Summary
--benchmarkpasses or fails as before. Mutations caught: removing the "verified pass only" guard; removing therunGoldenMode()hook; removing the reference-chain hook; narrowing the benchmark catch. The timing loop and statistics are autotune's and are covered by the frontend autotune tests.--golden-data-dir,--gtest_output=json, androcprofv3kernel stats (with warmup 3, the engine kernel ran 1 + 3 warmup + 20 timed times, with 20 stall waits).robusttime read 4-60% above the reference, and more timed iterations did not remove that. With 30 warmups, the median bias was 0.0-0.4% (p90 at most 2.3%), and the spread between runs was about 1%. The defaults are therefore 30 warmup and 20 timed executions. The wall time of the run did not change measurably (about 9 s for the MIOpen quick tier).tuned=0. WithHIPDNN_FORCE_BENCHMARKING=1, MIOpen logged tuning policy 3 (search) instead of 1 (none), and all 52 quick convolution bundles showedtuned=1. hipBLASLt has noglobal.benchmarkingknob and showedtuned=0for all 16 Matmul bundles with the same setting.--benchmark, and the full harness unit suite.Testing Checklist
build/bin/hipdnn_integration_tests_unit_tests- Status: Passed (1056 passed, 4 skipped as before)hipdnn_integration_tests_unit_tests --gtest_filter='*Benchmark*'- Status: Passedtunedfield - MIOpenquick_Convolution*with and withoutHIPDNN_FORCE_BENCHMARKING=1, hipBLASLtquick_Matmul*with it - Status: Passed (52tuned=0, 52tuned=1, 16tuned=0) - gfx90actest --test-dir build/dnn-providers/integration-tests -R hipdnn-integration-tests_test_name_validation- Status: Passeddvc pullofquick/BatchnormFwdInference/Inference/golden/small_fp32_nchw) ---verification-mode golden|auto --benchmark- Status: Passed (verified by golden, timed) - gfx90ahipdnn_integration_tests --test-article libmiopen_plugin.so --test-engine MIOPEN_ENGINE --test-config MIOPEN_ENGINE.toml --gtest_filter='quick_*' --benchmark --benchmark-iterations 5- Status: Passed (188 passed, 188 timed, allDEVICE_ONLY, 0 failed) - gfx90ahipdnn_integration_tests --gtest_filter='quick_Matmul*' --benchmark- Status: Passed (16/16 timed,engine=HIPBLASLT_ENGINE) - gfx90a-DBUILD_CPP_GRAPH_TESTS=ON,--no-bundles --gtest_filter='Smoke/*ConvFwd*' --benchmark --benchmark-iterations 10- Status: Passed (108 timed, 0 failed) - gfx90a--golden-data-dir /tmp/custom --gtest_filter='MyBn*' --benchmark- Status: Passed (verified by gpu_ref, timed) - gfx90a--benchmark-ctest --test-dir build/dnn-providers/miopen-provider -R '^miopen-provider-external-integration_quick_suite$'- Status: Passedhipdnn-providerspreset) - Status: PassedTechnical Changes
src/harness/Benchmark.hpp(new):BenchmarkSettingsandresolveBenchmark()flag validation.TestConfig.hppincludes only this header.src/harness/BenchmarkReport.hpp(new):selectEngineResult()(picks the engine under test from the autotune results),toString(TimingQuality), thetunedcheck, andreportBenchmark()(one[ BENCHMARK ]line plusbenchmark_*gtest properties; a result that did not succeed fails the test).src/harness/CurrentTestName.hpp(new):currentTestName(), moved out ofTomlGuards.hppso the report can reuse it.src/harness/GraphBenchmark.hpp(new):benchmarkGraph()callsGraph::autotune()withengineIdFilterset to the active plan's engine,FIXED_AVERAGE, and the--benchmarkwarmup and iteration counts, and returnsselectEngineResult().src/harness/PlanWorkspace.hpp(new):allocatePlanWorkspace(), the workspace size query and allocation shared byFrontendGraphEngineRunner::execute(),IntegrationGraphVerificationHarness::executeGpuGraph()and the benchmark.benchmarkIfVerified()catches exceptions from the benchmark and reports them as a failed benchmark, so a throw cannot replace the verified outcome.IGraphEngineRunner::benchmark()andHarnessPolicy::benchmark. A test is timed only after a PASSED, VERIFIED comparison. A benchmark failure fails the test but does not change the support-claim verdict.validateOutputs()when the test has no failure.main.cpp:--benchmark,--benchmark-iterations(default 20),--benchmark-warmup(default 30). The binary refuses--benchmarkwith--skip-graph-validation,--capture-bundlesor--write-support-claims, because those modes do not execute the graph.docs/running-tests.md(usage, output, which tests are not timed, custom graphs,rocprofv3kernel stats, CLI table) anddocs/README.md(signal row).Out of scope: per-op FLOP and bandwidth figures, and an all-engines sweep in one run. Use one run for each
--test-engine, or dnn-benchmarking.