Skip to content

[AIMIGRAPHX-885] Use External Stream Contexts#4775

Open
TedThemistokleous wants to merge 5 commits intodevelopfrom
use_external_contexts
Open

[AIMIGRAPHX-885] Use External Stream Contexts#4775
TedThemistokleous wants to merge 5 commits intodevelopfrom
use_external_contexts

Conversation

@TedThemistokleous
Copy link
Copy Markdown
Collaborator

Motivation

Customer workload seeing some stalls during inference. This allows us to use the customer hipSteam passed to context via run_async so that we don't need to internally sync and manage a thread within MIGraphX. This allows the synchronization to be handled externally.

As an added benefit if not external thread is used we should fall back to the old fork_join run on the GPU where we internally create a stream to sync events onto.

Technical Details

Adds additional conditions to the wait_for , finish_on calls in context.cpp such that we avoid new stream creation for async runs while also simplifying much of the code.

Test cases have been added for this to ensure we don't break existing functionality.
Additional code added to ensure we set external libraries like BLAS and MIOPEN to use the default stream on clear

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.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4775      +/-   ##
===========================================
+ Coverage    92.32%   92.45%   +0.12%     
===========================================
  Files          583      583              
  Lines        29334    29298      -36     
===========================================
+ Hits         27082    27085       +3     
+ Misses        2252     2213      -39     

see 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@causten causten requested a review from bdevorem April 10, 2026 21:27
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