Skip to content

[QNN-EP] Early fail if nodes unsupported while disable CPU fallback. - #1028

Merged
qti-chuteng merged 1 commit into
mainfrom
dev/minfhong/fail-on-unsupported
Oct 28, 2026
Merged

qti-chuteng merged 1 commit into
mainfrom
dev/minfhong/fail-on-unsupported

Conversation

@minfhong-qti

@minfhong-qti minfhong-qti commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Introduce a new flag has_unsupported_nodes_wo_cpu_fallback_ to early return fail during Compile if such scenario occurs in GetCapability.

Test

  • Add E2E testcases to check error code and message.
    • partial unsupported nodes
    • all unsupported nodes
    • GetCapability pass 1 unsupport but pass 2 support
  • Add framework op trace testcases.

Motivation and Context

When disable_cpu_ep_fallback is set and there are unsupported nodes, session initialization will eventually fail but only after performing compile and graph transformations which can be skipped.

Comment thread onnxruntime/core/providers/qnn/qnn_execution_provider.cc Outdated
@minfhong-qti
minfhong-qti force-pushed the dev/minfhong/fail-on-unsupported branch from 1f2ac5d to 2db334b Compare October 21, 2026 09:14
@minfhong-qti
minfhong-qti force-pushed the dev/minfhong/fail-on-unsupported branch from 2db334b to 4d44bb6 Compare October 22, 2026 02:04
Comment thread onnxruntime/core/providers/qnn/qnn_execution_provider.cc
Comment thread onnxruntime/core/providers/qnn/qnn_execution_provider.cc

@huaychou huaychou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, does ORT core have similar mechanism to early stop?

Comment thread onnxruntime/core/providers/qnn/qnn_execution_provider.cc
Comment thread onnxruntime/core/providers/qnn/qnn_execution_provider.cc
Comment thread onnxruntime/test/providers/qnn/qnn_basic_test.cc
@minfhong-qti
minfhong-qti force-pushed the dev/minfhong/fail-on-unsupported branch 2 times, most recently from d3545a0 to a7d57c4 Compare October 23, 2026 07:12
@minfhong-qti

Copy link
Copy Markdown
Collaborator Author

Just wondering, does ORT core have similar mechanism to early stop?

ORT provides an API to allow "user" to early stop. Refer to https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/session/onnxruntime_c_api.h#L5571. Since EP can set this flag but it requires modifying user-own session option, it would have side effects.

@huaychou huaychou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please check the CI failure.

When disable_cpu_ep_fallback is set and there are unsupported nodes,
session initialization will eventually fail but only after performing
compile and graph transformations which can be skipped.
Introduce a new flag `has_unsupported_nodes_wo_cpu_fallback_` to early
return fail during Compile if such scenario occurs in GetCapability.
Test
  - Add E2E testcases to check error code and message.
    - partial unsupported nodes
    - all unsupported nodes
    - GetCapability pass 1 unsupport but pass 2 support
  - Add framework op trace testcases.
@minfhong-qti
minfhong-qti force-pushed the dev/minfhong/fail-on-unsupported branch from a7d57c4 to fd01841 Compare October 27, 2026 07:39
@qti-chuteng
qti-chuteng merged commit 6e999f9 into main Oct 28, 2026
57 checks passed
@qti-chuteng
qti-chuteng deleted the dev/minfhong/fail-on-unsupported branch October 28, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants