Skip to content

Three operator conditional blocks removed to get migraphx ep working for certain models#221

Open
tamahedi wants to merge 2 commits intowml-main-wcrforamdfrom
tamahedi/nonzero_and_range_issue
Open

Three operator conditional blocks removed to get migraphx ep working for certain models#221
tamahedi wants to merge 2 commits intowml-main-wcrforamdfrom
tamahedi/nonzero_and_range_issue

Conversation

@tamahedi
Copy link
Copy Markdown

@tamahedi tamahedi commented Mar 2, 2026

Description

In migraphx_execution_provider.cc, within IsUnsupportedOpMode the conditional blocks for optype NonZero, Range and MaxPool were removed.

Motivation and Context

For some models (MeloTTS and SIE:SmolVLM2-500M-Video-Instruct:vision_* models) these three operators were being reported unsupported by migraphx ep but they are in the supported list. These conditionals were removed because when stepping through their code path they enter canEvalShapeGeneral and then eventually to IsGraphInput(graph, input_name) where it returns false from. After removing the conditional the two operators were no longer an issue.

A new issue stemmed later on for MeloTTS:
Error: C:/w/src/include\migraphx/op/multibroadcast.hpp:87: compute_shape: MULTIBROADCAST: input shape {0} cannot be broadcasted to {1, 1}!
Error: Non-zero status code returned while running MGXKernel_graph_main_graph_15922752454231187159_0 node. Name:'MIGraphXExecutionProvider_MGXKernel_graph_main_graph_15922752454231187159_0_0' Status Message: Failed to call function

Ticket related to it: https://amd-hub.atlassian.net/browse/AIRADSW-61

for some SmolVLM2-500M-Video-Instruct:vision_ models:
Error simplify_reshapes: C:/w/src/include\migraphx/check_shapes.hpp:220: same_dims: equal: Dimensions do not match
Dump: "C:\Users\tamahedi\AppData\Local\Temp\migraphx\simplify_reshapes1552374039121400.mxr"
: Error: C:/w/src/include\migraphx/check_shapes.hpp:220: same_dims: equal: Dimensions do not match
Error: Non-zero status code returned while running MGXKernel_graph_main_graph_6827965760175395044_0 node. Name:'MIGraphXExecutionProvider_MGXKernel_graph_main_graph_6827965760175395044_0_0' Status Message: Failed to call function

Ticket related to it: https://amd-hub.atlassian.net/browse/AIRADSW-59

MaxPool Conditional removal fixed ResNet50_int8 and Squeezenet_int8 errors.

MaskRCNN-12 had nonzero unsupported errors but these changes only led to another error:
: Error: C:/Users/taccuser/Documents/AMDMIGraphX/src/targets/gpu/include\migraphx/gpu/context.hpp:341: wait_for: Failed to record: context is destroyed
2026-02-27 10:19:20.9204205 [E:onnxruntime:, sequential_executor.cc:572 onnxruntime::ExecuteKernel] Non-zero status code returned while running MGXKernel_graph_torch-jit-export_15747441500071067602_0 node. Name:'MIGraphXExecutionProvider_MGXKernel_graph_torch-jit-export_15747441500071067602_0_0' Status Message: Failed to call function
Run failed:PerformanceRunner::RunOneIteration caught exception: Non-zero status code returned while running MGXKernel_graph_torch-jit-export_15747441500071067602_0 node. Name:'MIGraphXExecutionProvider_MGXKernel_graph_torch-jit-export_15747441500071067602_0_0' Status Message: Failed to call function

MaskRCNN-12-int8 originally had issues with maxpool and nonzero being unsupported. Now:
Error simplify_qdq: C:/w/src/include\migraphx/check_shapes.hpp:220: same_dims: quantizelinear: Dimensions do not match
Dump: "C:\Users\tamahedi\AppData\Local\Temp\migraphx\simplify_qdq1712991398399200.mxr"
: Error: C:/w/src/include\migraphx/check_shapes.hpp:220: same_dims: quantizelinear: Dimensions do not match
Error: Exception during initialization: Failed to call function

Originally the mentioned models here had a problem reporting MaxPool, NonZero or Range as unsupported. These are their later results.
All the models mentioned here work with cpu and dml ep.

@tamahedi tamahedi added Bug Something isn't working help wanted Extra attention is needed labels Mar 2, 2026
@tamahedi tamahedi changed the title Two operator conditional blocks removed to get migraphx ep working for certain models Three operator conditional blocks removed to get migraphx ep working for certain models Mar 2, 2026
@TedThemistokleous
Copy link
Copy Markdown
Collaborator

TedThemistokleous commented Mar 2, 2026

Why are you removing checks for these operators? What errors are you seeing? Is this tied to another ticket? Please PM me the info and issue you're experiencing. We shouldn't be removing checks as part of a fix.

The checks are there as this signals unsupported behavior/inputs for the given operators. If you require changes on the MIGraphX side for the parsers due to new inputs/modes this should be discussed.

@apwojcik
Copy link
Copy Markdown
Collaborator

apwojcik commented Apr 9, 2026

The PR requests a merge to the wrong branch. Please use rel-1.23.5-wml instead.

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

Labels

Bug Something isn't working help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants