Skip to content

Fix compile error in tensor_impl_ort.h, extend ShapeFoldingInterpreter, and make shape validation non-fatal#1

Closed
arisha07 wants to merge 1 commit into
miaobin:webnn-fully-dynamic-rebasefrom
arisha07:sfi-nonfatal-fixes
Closed

Fix compile error in tensor_impl_ort.h, extend ShapeFoldingInterpreter, and make shape validation non-fatal#1
arisha07 wants to merge 1 commit into
miaobin:webnn-fully-dynamic-rebasefrom
arisha07:sfi-nonfatal-fixes

Conversation

@arisha07
Copy link
Copy Markdown

@arisha07 arisha07 commented Jun 2, 2026

Changes

  1. Fix compile error (tensor_impl_ort.h): Rename gpu_sequence_checker_ → sequence_checker_ to match the base class member. The branch does not compile without this fix.

  2. Extend ShapeFoldingInterpreter (shape_folding_interpreter.cc): Add 10 binary operations : Equal, Greater, GreaterOrEqual, Lesser, LesserOrEqual, NotEqual, LogicalAnd, LogicalOr, LogicalXor, Pow. These enable shape subgraph folding for models that use comparison or logical ops in their shape-computation chains.

  3. Non-fatal shape validation (webnn_context_impl.cc): Convert InferAndValidateConcreteShapes and output ValidateWebNNTensors failures from hard errors (reject dispatch) to warnings (log + proceed). This allows models with partially-unresolvable dynamic dimensions to still execute on GPU rather than failing entirely.

Motivation

When paired with the ORT-side ShapeSubgraphFolder (onnxruntime PR #21), these Chromium-side changes serve as a safety net:

  1. The ORT folder handles shape folding for common models (Llama, Qwen) with freeDimensionOverrides
  2. The extended SFI ops and non-fatal validation provide defense-in-depth for:
    • Future models with more complex shape subgraphs
    • Non-ORT WebNN clients that don't have their own shape folder
    • Edge cases where freeDimensionOverrides doesn't cover all dynamic dims

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Thanks for your contribution! Unfortunately, we don't use GitHub pull requests to manage code contributions to this repository. Instead, please see README.md which provides full instructions on how to get involved.

@github-actions github-actions Bot closed this Jun 2, 2026
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