[hipDNN] [ALMIOPEN-2156] - Add runtime (dlopen) backend-loading mode#8792
Draft
mousdahl-amd wants to merge 1 commit into
Draft
[hipDNN] [ALMIOPEN-2156] - Add runtime (dlopen) backend-loading mode#8792mousdahl-amd wants to merge 1 commit into
mousdahl-amd wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (77.90%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #8792 +/- ##
===========================================
- Coverage 65.01% 65.00% -0.01%
===========================================
Files 2610 2613 +3
Lines 405621 405953 +332
Branches 60550 60587 +37
===========================================
+ Hits 263692 263863 +171
- Misses 122015 122169 +154
- Partials 19914 19921 +7
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
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
Adds an opt-in runtime-load mode for the header-only hipDNN frontend. A new
hipdnn_frontend_dynamicCMake interface target resolves the backend at runtime viadlopen/dlsym(Linux) orLoadLibrary/GetProcAddress(Windows), so consumers likelibMIOpen.socan use the frontend without inheriting a hardDT_NEEDEDonlibhipdnn_backend. The consumer chooses at their own configure time by linkinghipdnn_frontend(direct-link, existing behavior) orhipdnn_frontend_dynamic(runtime-load) — no hipDNN rebuild required to switch.Risk Assessment
Medium risk. This adds a new feature path (opt-in consumer target) that touches the core frontend interface (
IHipdnnBackend+3 methods), CMake packaging (two exported targets over shared headers), and logging routing. Default behavior is unchanged — existing consumers linkinghipdnn_frontendare unaffected. Local unit coverage is strong (1522 tests), but Linux and GPU execution testing of the dynamic path are still pending.ASIC Coverage
Standard PR CI is sufficient. This is ASIC-independent frontend-to-backend wiring: it changes how backend symbols are resolved (linked vs. dlopen'd), not which kernels run or how ops dispatch. No kernel selection, support surface, or default behavior is affected.
Testing Summary
hipdnn_frontend_dynamictarget is consumable with zero backend symbol references.Testing Checklist
cmake --build build --target hipdnn_frontend_tests- Status: Passed (1522/1522, Windows)cmake --build build --target hipdnn_frontend_runtime_load_static_check- Status: Passed (Windows)HIPDNN_FRONTEND_RUNTIME_LOAD_BACKEND- Status: Passed (Windows)Technical Changes
HipdnnDynamicBackendWrapper, anIHipdnnBackendimplementation that resolves all ~29 backend entry points viadlopen/dlsymat construction time, caching typed function pointers.decltype(&symbol)is used in an unevaluated context so no link-time reference is created.DynamicBackendLibrary.hppwith acall_once-guarded library handle opener and aresolveSymbolhelper, reusing the cross-platform loader already inhipdnn_data_sdk::utilities.HipdnnDirectBackendWrapper.hpp(renamed fromHipdnnBackendWrapper) to mirror the dynamic wrapper's file structure.BackendWrapper.hppnow contains only the factory logic.IHipdnnBackendwith 3 logging methods (setUserLogCallbackExt,backendSetGlobalLogLevelExt,backendGetGlobalLogLevelExt) so the user-facing logging APIs route through the interface instead of calling backend symbols directly. The logging callback pointer stays resolved via a standalone helper to avoid re-entering the loader during init.hipdnn_frontend(direct-link, unchanged) andhipdnn_frontend_dynamic(runtime-load). The dynamic target borrows backend compile usage requirements via$<TARGET_PROPERTY:...>generator expressions without linking the library.hipdnn_frontend_runtime_load_static_check) that links the shippedhipdnn_frontend_dynamictarget — a successful link proves no backend symbol leaks through in runtime-load mode.samples/dynamic/ConvFpropDynamic.cpp) that links onlyhipdnn_frontend_dynamic, builds and verifies a deterministic convolution, proving the installed target is end-to-end consumable without the backend on the link line.