Skip to content

Microsoft WebNN demo applications cannot successfully run in ORT-WebGPU backend with CPU fallback disabled #29756

Description

@qwu16

Describe the issue

When running WebNN demos in https://microsoft.github.io/webnn-developer-preview/ with ORT-WebGPU EP and ORT CPU fallback disabled, all demo applications cannot successfully run. After applying PR #29682, following demo applications cannot successfully run:

Segment Anything, Stable Diffusion 1.5, and Stable Diffusion XL Turbo

After dumping the log, we can see that some kernels are not supported in WebGPUExecutionProvider as follow:

LookUpKernel[WebGpuExecutionProvider] no kernel for Cast(Inserted_Cast_89): Op with name (Inserted_Cast_89) domain () and type (Cast) kernel is not supported in WebGpuExecutionProvider. Encountered following errors: ( Version mismatch. node_version: 21 kernel start version: 6 kernel_end_version: 8
Version mismatch. node_version: 21 kernel start version: 9 kernel_end_version: 12
Version mismatch. node_version: 21 kernel start version: 13 kernel_end_version: 18
Version mismatch. node_version: 21 kernel start version: 19 kernel_end_version: 20
Kernel found kernel in the supported version range (node_version: 21). However the types are incompatible. This op has been implemented only for the following types (tensor(float16),tensor(float),tensor(int32),tensor(uint32),tensor(bool),), but the node in the model has the following type (tensor(uint8))
Version mismatch. node_version: 21 kernel start version: 23 kernel_end_version: 2147483647
Version mismatch. node_version: 21 kernel start version: 24 kernel_end_version: 2147483647

More unsupported log info can be found in attached doc

webnn-demo.log

To reproduce

  1. Launch chrome canary with flags "--enable-features=WebMachineLearningNeuralNetwork,WebNNOnnxRuntime --webnn-ort-disable-cpu-fallback --webnn-ort-logging-level=VERBOSE --webnn-ort-ep-device=WebGpuExecutionProvider,0x8086,0x64a0", replace 0x8086,0x64a0 with vendor and and device info of your machine in chrome://gpu
  2. Open https://microsoft.github.io/webnn-developer-preview/ and test failed demo applications listed above, related ort logs can be found in chrome://gpu

Urgency

No response

Platform

Windows

OS Version

Win11 25H2

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

361184e

ONNX Runtime API

C++

Architecture

X64

Execution Provider

Other / Unknown

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ep:WebGPUort-web webgpu providerep:WebNNWebNN execution providerplatform:webissues related to ONNX Runtime web; typically submitted using template

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions