[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"
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
- Install Windows App SDK Stable 1.8.2 (1.8.251003001)
- Install lates Edge Canary browser
- Launch Edge Canary browser, navigate to
about://flagsenabled "Enables WebNN API" and "ONNX Runtime backend for WebNN" flags, then relaunch browser - 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=0by testing ORT default CPU EP orhttps://wpt.live/webnn/conformance_tests/batch_normalization.https.any.html?device=gpu&tc=batchNormalization%20float32%201D%20tensor%20options.axis=0by testing ORT default GPU EP - 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."
- 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