Repository navigation
Keep the legacy MIGraphX provider mapped on Linux - #253
Draft
varyagnord wants to merge 1 commit into
Draft
varyagnord wants to merge 1 commit into
varyagnord wants to merge 1 commit into
Conversation
Preserve the shared library mapping through process exit so MIGraphX callbacks can complete after the ONNX Runtime environment has shut down. Keep provider shutdown and lazy loading in place. Verified the lifetime behavior with a standalone Conv + Relu model on Fedora ONNX Runtime 1.26.0 and Radeon gfx1150. Both runs returned the correct tensor. The default unload exited 139 and holding a loader reference exited 0. Assisted-by: OpenAI Codex
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.
Description
Keep the built-in MIGraphX provider shared library mapped on Linux after ONNX Runtime shuts down its execution provider. This uses the provider bridge's existing
unload=falsebehavior, as used by CUDA and CANN. Provider shutdown and session destruction still run. Windows and separately registered plugin EPs are outside this change.Motivation and context
With the built-in shared MIGraphX EP, a small Conv + Relu model completes successfully and its session and environment are destroyed in the expected order. The process then receives SIGSEGV. The loader trace shows that
libmigraphx.so.2015000was unmapped. The exit backtrace enters the cleanup of MIGraphX's process-static dynamic target loader vector after that unload.Keeping a reference to the EP shared library prevents the loader from unmapping the dependency while exit callbacks can still execute. Preserving the mapping increases the memory retained after the last environment is destroyed. The library is still loaded lazily on first use.
The target branch is the ROCm legacy GPU EP release. The failing configuration was Fedora's ONNX Runtime 1.26.0 shared MIGraphX build with ROCm 7.2.2 / MIGraphX 2.15.0 on Radeon 890M (gfx1150).
Verification
The second test uses Linux
dlopen(..., RTLD_NOLOAD)to validate the library-lifetime change against the same Fedora binary. It is a behavioral A/B test; it does not represent a full build of the target ROCm release branch. A separate downstream test held just the MIGraphX dependency mapped and also exited successfully. The original failure needs no OBS process or segmentation model.Standalone reproducer
Generate a small model with the Python
onnxpackage:Save the following as
reproduce.cpp:Build against an ONNX Runtime distribution with the legacy shared MIGraphX EP:
Prepared with OpenAI Codex assistance.