Skip to content

refactor(miopen): remove dead in-file code across driver, batch norm, tensor ops, and CMake - #11648

Merged
averinevg merged 12 commits into
developfrom
users/evaverin/ALMIOPEN-2571/code-removals-only
Sep 3, 2026
Merged

averinevg merged 12 commits into
developfrom
users/evaverin/ALMIOPEN-2571/code-removals-only

Conversation

@averinevg

@averinevg averinevg commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This change removes verified-dead in-file code from MIOpen: unreachable driver CPU-verify code, a legacy batch-norm kernel-select dispatch layer, duplicate workspace-size boilerplate on 10 tensorOp and 2 softmax solvers, unread struct fields/macros in mlo_internal.hpp/dropout.hpp/buffer_info.hpp, a dead CK preprocessor gate, and dead CMake variables/helpers in test/CMakeLists.txt and speedtests/CMakeLists.txt. This is a pure deletion. It does not change program behavior.

JIRA ID : ALMIOPEN-2571

Risk Assessment

Risk level: 2. Every removed item was independently verified for callers/includers/references, including checking that earlier same-branch commits hadn't already orphaned declarations. A full differential build-and-test sweep against an unmodified baseline found 0 regressions across 4 configs.

ASIC Coverage

This removes unreferenced code only — no kernel, dispatch, or heuristic logic changed, so the change is architecture-independent. Verified locally on gfx90a (MI210), the only hardware available in this environment. A passing PR CI run is sufficient; a multi-arch sweep is not necessary.

Testing Summary

  • Built the base library + MIOpenDriver from scratch on both this branch and an unmodified baseline.
  • Ran the full ctest suite. Results are identical between branch and baseline in every config.

Testing Checklist

  • Full ctest
  • PR CI - GitHub PR checks

Technical Changes

  • Remove ~850 lines of dead driver CPU-verify code (mloConvHost.hpp, miopen_ConvBatchNormActivHost.hpp, mloPoolingHost.hpp, util_driver.hpp) and their now-dead call sites/includes in bn_driver.hpp/conv_driver.hpp/driver.hpp.
  • Remove the dead legacy batch-norm kernel-select dispatch layer: 5 function definitions in batch_norm.cpp and their declarations in batch_norm.hpp, plus 2 now-unread macros.
  • Remove duplicate GetWorkspaceSize/MayNeedWorkspace overrides (exact base-class-default duplicates) from 10 tensorOp solvers and 2 softmax solvers (Softmax, AttnSoftmax).
  • Remove dead tie_array_impl/tien_array templates from tensor.hpp.
  • Remove unread mlo_internal.hpp fields/macros (_workspace_sz/getWorkSpaceSzBytes(), _bot_df_sz/_top_df_sz, _out_df_*, _in_df_layout/_in_df_data_type, 2 unused macros) and their one write site in mloNorm.cpp.
  • Remove unused xorwowStates/prngStates from dropout.hpp and the unread direct[] field from WinogradBufferInfo in buffer_info.hpp.
  • Collapse a dead, always-false CK preprocessor gate in legacy_composable_kernel/.../config.hpp.
  • Remove dead CMake variables/helpers from test/CMakeLists.txt and a copy-paste-orphaned separate_arguments call in speedtests/CMakeLists.txt.

averinevg and others added 12 commits September 2, 2026 13:10
…hnorm portion)

Removes unused legacy CPU-conv/BN reference headers, verify helpers,
and unread macros/members from the driver, plus their dangling
#include lines. Zero callers found for all removed symbols.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e (C1)

bnFwdTrainSelectMulti and its dead-code neighbors have zero callers;
drops the now-unneeded visit_float.hpp/chrono includes with them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ides in tensorOp solvers

These overrides across the 10 tensorOp solvers are never invoked; the
base class defaults already cover their behavior. Zero callers found.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…est/CMakeLists.txt

Removes MIOPENDRIVER_MODE_*/MIOPEN_TEST_CONV_INT8_OUTPUT_TYPE_* variables
orphaned by earlier ctest-to-gtest migrations, the XNACK_TESTS mechanism
left over from the deleted metadata-graph fusion test, stale bfloat16
SKIP_ALL_EXCEPT_TESTS entries that no longer map to any test target, and
unused IMPLICITGEMM_MLIR_ENV_*_XDLOPS/DYNAMIC_IMPLICITGEMM_*/ARGS_NCHWC_*/
CONV_CK_IGEMM_FWD_V6R1_DLOPS_NCHW_ENV variables with zero references.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…m tensor.hpp

Zero callers anywhere in the codebase.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…macro

Its only consumer, the #if gate in multi_index.hpp, was already
collapsed to the single surviving #include in an earlier commit,
leaving this unconditional #define with zero remaining references.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ides in softmax solvers

Both overrides duplicate the base Solver class's defaults
(GetWorkspaceSize returns 0, MayNeedWorkspace returns false).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
No reads anywhere in the codebase.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rm construct headers

Removes orphaned bnBwdTrainSelect*/bnFwdTrainSelect* declarations left
behind after their .cpp definitions were deleted, unused
MIOPEN_BN_CPP_DEBUG/MIO_BN_STATIC_WGSIZE macros, an unreferenced
xorwowStates/prngStates typedef in dropout.hpp, and a cluster of
write-only fields (_workspace_sz/getWorkSpaceSzBytes, _bot_df_sz,
_top_df_sz, _out_df_width/height/layout/data_type, _in_df_layout,
_in_df_data_type) and unused MLO_POOLING_OP_STC/MLO_LRN_WITHIN_CHANNEL
macros in mlo_internal.hpp/mloNorm.cpp with no readers anywhere in the
tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…MakeLists.txt

Copy-pasted from test/CMakeLists.txt when this file was created in
2020; MIOPEN_TEST_FLAGS_ARGS was never plumbed into any speedtest
COMMAND/target here, unlike its genuinely-used counterpart in
test/CMakeLists.txt.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@averinevg
averinevg requested a review from a team as a code owner September 3, 2026 09:05
@therock-pr-bot

therock-pr-bot Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/miopen/driver/bn_driver.hpp, projects/miopen/driver/conv_driver.hpp, projects/miopen/driver/driver.hpp, projects/miopen/driver/miopen_ConvBatchNormActivHost.hpp, projects/miopen/driver/mloConvHost.hpp (+23 more); no test file found
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@iq136boy iq136boy 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.

LGTM

@averinevg
averinevg merged commit fde135b into develop Sep 3, 2026
169 of 174 checks passed
@averinevg
averinevg deleted the users/evaverin/ALMIOPEN-2571/code-removals-only branch September 3, 2026 13:55
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants