onnxruntime icon indicating copy to clipboard operation
onnxruntime copied to clipboard

[ORT CPU][ORT GPU (DML)][WebNN] Fail to run WebNN batchNormalization tests with 1D tensor due to "Dimension mismatch in unification between 6 and 1"

Open BruceDai opened this issue 1 month ago • 0 comments

Describe the issue

Fail to run WebNN batchNormalization tests with 1D tensor by ORT default CPU EP and ORT default GPU DML EP due to below error

error message: Node (_0) Op (BatchNormalization) [ShapeInferenceError] Dimension mismatch in unification between 6 and 1

/cc @fdwr PTAL, thanks!

To reproduce

  1. Install Windows App SDK Stable 1.8.2 (1.8.251003001)
  2. Install lates Edge Canary browser
  3. Launch Edge Canary browser, navigate to about://flags enabled "Enables WebNN API" and "ONNX Runtime backend for WebNN" flags, then relaunch browser
  4. Navigate to this test url https://wpt.live/webnn/conformance_tests/batch_normalization.https.any.html?device=cpu&tc=batchNormalization%20float32%201D%20tensor%20options.axis=0 by testing ORT default CPU EP or https://wpt.live/webnn/conformance_tests/batch_normalization.https.any.html?device=gpu&tc=batchNormalization%20float32%201D%20tensor%20options.axis=0 by testing ORT default GPU EP
  5. We can find "batchNormalization float32 1D tensor options.axis=0" test run Fail with the error of "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Failed to create session."
  6. Navigate to about://gpu, we can get the log message like

error message: Node (_0) Op (BatchNormalization) [ShapeInferenceError] Dimension mismatch in unification between 6 and 1

Same issue to run batchNormalization float16 1D tensor options.axis=0 of fp16 test, test url https://wpt.live/webnn/conformance_tests/batch_normalization.https.any.html?device=cpu&tc=batchNormalization%20float16%201D%20tensor%20options.axis=0 by testing ORT default CPU EP or https://wpt.live/webnn/conformance_tests/batch_normalization.https.any.html?device=gpu&tc=batchNormalization%20float16%201D%20tensor%20options.axis=0 by testing ORT default GPU EP

Urgency

No response

ONNX Runtime Installation

Released Package Windows App SDK Stable 1.8.2 (1.8.251003001)

ONNX Runtime Version or Commit ID

1.23.25.928

Execution Provider

ORT default CPU EP, ORT default GPU EP

BruceDai avatar Nov 07 '25 03:11 BruceDai