microsoft / microsoft/onnxruntime
[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"
@hariharans29 is already working on this.
Since Nov 12, 2025.
- Dominant language
- C++
- Stars
- 21.9k
- Forks
- 4.2k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 184
Description
### 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)](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/stable-channel#version-18)
2. Install [lates Edge Canary browser](https://www.microsoft.com/en-us/edge/download/insider?form=MA13FJ)
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)](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/stable-channel#version-18)
### ONNX Runtime Version or Commit ID
1.23.25.928
### Execution Provider
ORT default CPU EP, ORT default GPU EP
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.