Skip to content

[WebNN EP] Add output rank validation - #31708

Open
Wanming Lin (Honry) wants to merge 1 commit into
microsoft:mainfrom
Honry:limit-output-rank
Open

[WebNN EP] Add output rank validation#31708
Wanming Lin (Honry) wants to merge 1 commit into
microsoft:mainfrom
Honry:limit-output-rank

Conversation

@Honry

Copy link
Copy Markdown
Contributor

Mirror the existing input rank check by validating each node's output rank against the WebNN opSupportLimits's rankRange.

  • Rename IsInputRankSupported -> IsRankSupportedByWebNNOp and skip the check when the op / parameter / rankRange is undefined in MLOpSupportLimits to make it compatible with older browers.
  • Add IsOutputRankSupportedByOp for the common single-"output" case.
  • Add output rank checks to multi-output ops (gru, lstm, split) using their specific output parameter names.
  • Skip decomposed ops (their type checks loop over sub-ops whose ranks differ from the final output).

Mirror the existing input rank check by validating each node's output
rank against the WebNN opSupportLimits rankRange.

- Rename IsInputRankSupported -> IsRankSupportedByWebNNOp and skip the
  check when the op / parameter / rankRange is undefined in MLOpSupportLimits
  to make it compatible with older browers.
- Add IsOutputRankSupportedByOp for the common single-"output" case.
- Add output rank checks to multi-output ops (gru, lstm, split) using
  their specific output parameter names.
- Skip decomposed ops (their type checks loop over sub-ops whose ranks
  differ from the final output).
@azure-pipelines

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

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.

1 participant