Skip to content

Allow zero input for EpContext node - #29799

Merged
adrastogi merged 2 commits into
microsoft:mainfrom
shiyi9801:allow_0_input
Jul 23, 2026
Merged

Allow zero input for EpContext node#29799
adrastogi merged 2 commits into
microsoft:mainfrom
shiyi9801:allow_0_input

Conversation

@shiyi9801

Copy link
Copy Markdown
Contributor

Description

Set min_arity of inputs to zero in EPContext node registration.

Motivation and Context

PR #28771 relaxed CompileModel validation to accept zero-input OrtModel graphs, so EpContext node should also accept zero-input.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@shiyi9801

Copy link
Copy Markdown
Contributor Author

Hi adrastogi Dwayne Robinson (@fdwr) Please take a look, thanks!
This PR fixes an issue:

Failed to call ort_compile_api->CompileModel(env->get(), compile_options.get()): [WebNN] ORT status error code: 10 error message: This is an invalid model. In Node, ("OpenVINOExecutionProvider_OpenVINOExecutionProvider_3884444976624952189_0_0", EPContext, "com.microsoft", -1) : () -> ("output-1_1": tensor(float),"output-0_0": tensor(float),) , Error Node(OpenVINOExecutionProvider_OpenVINOExecutionProvider_3884444976624952189_0_0) with schema(com.microsoft::EPContext:1) has input size 0 not in range [min=1, max=2147483647].

Comment thread onnxruntime/core/graph/contrib_ops/contrib_defs.cc
Comment thread docs/ContribOperators.md

@fdwr Dwayne Robinson (fdwr) 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.

👍

@fdwr

Copy link
Copy Markdown
Contributor

/azp run Test Linux CUDA x64 Release,Test Linux TensorRT x64 Release,web_Debug / build_onnxruntime_web,web_Release / build_onnxruntime_web

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@fdwr

Copy link
Copy Markdown
Contributor

Comment mostly for the ORT folks to assess any implications of this

adrastogi Do you want someone else from ORT to look at this? Otherwise I'm content to merge (I don't see how relaxing this restriction causes any compat issues, since ORT is backwards compatible, with no guarantee of forward compatibility with newer opsets or constraints).

@adrastogi

Copy link
Copy Markdown
Contributor

Dwayne Robinson (@fdwr) thanks! No, I think we're good here, thanks for evaluating that comment.

@adrastogi
adrastogi merged commit 1b1e1db into microsoft:main Jul 23, 2026
86 checks passed
adrastogi added a commit that referenced this pull request Aug 12, 2026
This cherry-picks the following commits for the release:

* #29799 
* #29755
* #29681

---------

Co-authored-by: shiyi <shiyi.zou@intel.com>
Co-authored-by: mingmingtasd <mingming1.xu@intel.com>
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.

3 participants