Skip to content

[Cherrypick from win-onnxruntime] Add MigraphX EP support for auto EP - #25481

Merged
wonchung-microsoft merged 15 commits into
mainfrom
dev/wonchung/auto_ep_migraphx
Jul 23, 2025
Merged

wonchung-microsoft merged 15 commits into
mainfrom
dev/wonchung/auto_ep_migraphx

Conversation

@wonchung-microsoft

@wonchung-microsoft wonchung-microsoft commented Jul 21, 2025 •

Copy link
Copy Markdown
Contributor

Cherrypick from the following branches in win-onnxruntime repo.
dev/amd/ozhang/update_mgx_ep_creation
dev/kvadsariya/auto_ep_migraphx

This change allows MigraphX EP (AMD GPU EP) to be selected through auto ep (prefer gpu) policy.

@nieubank

Copy link
Copy Markdown
Contributor

You'll probably want to add a test for this since MiGraphX has a provider test in migraphx_basic_test.cc. Something like

TEST(MIGraphXExecutionProviderTest, AutoEp_PreferGpu) {
  PathString model_name = ORT_TSTR("migraphx_basic_test.onnx");
  
  onnxruntime::Model model("test", false, DefaultLoggingManager().DefaultLogger());
  std::vector<int> dims = {1, 3, 2};
  CreateBaseModel(model, dims);
 
  auto status = onnxruntime::Model::Save(model, model_name);
  ASSERT_TRUE(status.IsOK());

  auto env = Ort::Env();
  env.UpdateEnvWithCustomLogLevel(OrtLoggingLevel::ORT_LOGGING_LEVEL_WARNING);

  {
    env.RegisterExecutionProviderLibrary(kMIGraphXExecutionProvider, ORT_TSTR("onnxruntime_providers_migraphx.dll"));

    Ort::SessionOptions so;
    so.SetEpSelectionPolicy(OrtExecutionProviderDevicePolicy_PREFER_GPU);
    Ort::Session session_object(env, model_name.c_str(), so);
    EXPECT_TRUE(SessionHasEp(session_object, kMIGraphXExecutionProvider));
  }

  env.UnregisterExecutionProviderLibrary(kMIGraphXExecutionProvider);
}

Karim Vadsariya and others added 5 commits July 22, 2025 13:47
Remove #ifdef MIGRAPHX so that the ort bin built for generic interface
and ep bin built without use_migraphx are still compatible. Currently,
ort bin built with use_generic has different struct from ep bin like
VitisAI which does not utilize use_generic nor use_migraphx, ending up
in a crash.

@github-actions github-actions Bot 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.

You can commit the suggested changes from lintrunner.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
wonchung-microsoft and others added 3 commits July 22, 2025 21:16
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@TedThemistokleous

Copy link
Copy Markdown
Contributor

How was this even approved? This breaks builds completely on Linux side builds

image

@TedThemistokleous

Ted Themistokleous (TedThemistokleous) commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor

Hey it looks like your team pulled out the CI entirely for MIGraphX, and this is why all your testing looks good. There's no coverage anymore for MIGraphX EP being done. Not sure why this wasn't discussed between our teams but we're flying blind without any CI during integration.

#25418

@snnn

Copy link
Copy Markdown
Contributor

Hi there! We haven't cut the release branch for this version yet, so I'm removing the release:1.23.0 label for now to keep things tidy. Thanks so much for your contribution! We'll make sure this gets included when the release is prepared. 🤖

Changming Sun (snnn) pushed a commit that referenced this pull request Jul 29, 2025
…me (#25516)

After cherry-picking from win-onnxruntime (#25481), the MIGraphX EP
stopped compiling on the main branch.
Pradeep Sakhamoori (psakhamoori) pushed a commit to psakhamoori/onnxruntime that referenced this pull request Aug 5, 2025
…me (microsoft#25516)

After cherry-picking from win-onnxruntime (microsoft#25481), the MIGraphX EP
stopped compiling on the main branch.
Sanket Kale (sanketkaleoss) pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
…microsoft#25481)

Cherrypick from the following branches in win-onnxruntime repo.
dev/amd/ozhang/update_mgx_ep_creation
dev/kvadsariya/auto_ep_migraphx

This change allows MigraphX EP (AMD GPU EP) to be selected through auto
ep (prefer gpu) policy.

---------

Co-authored-by: Karim Vadsariya <kvadsariya@microsoft.com>
Co-authored-by: ozhang <ozhang@amd.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sanket Kale (sanketkaleoss) pushed a commit to sanketkaleoss/onnxruntime that referenced this pull request Aug 11, 2025
…me (microsoft#25516)

After cherry-picking from win-onnxruntime (microsoft#25481), the MIGraphX EP
stopped compiling on the main branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ep:MIGraphX issues related to AMD MI GraphX execution provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants