Skip to content

Conversation

@Honry
Copy link
Contributor

@Honry Honry commented Oct 23, 2025

ONNX Softmax operates with different semantics before and after opset 13. Before opset 13, it normalizes over the flattened range of dimensions starting from axis to the last dimension. Fix it by reshaping the input to [M, N] where M = prod(d0..d{axis-1}) and N = prod(d{axis-1}..d{n-1}) and applying softmax along N, then reshaping back to the original shape.

ONNX Softmax operates with different semantics before and after opset 13.
Before opset 13, it normalizes over the flattened range of dimensions
starting from axis to the last dimension. Fix it by reshaping the input
to [M, N] where M = prod(d0..d{axis-1}) and N = prod(d{axis-1}..d{n-1})
and apply softmax along N, then reshaping back to the original shape.
@Honry
Copy link
Contributor Author

Honry commented Oct 23, 2025

@fdwr, @guschmue, PTAL, thanks!

@guschmue guschmue added the ep:WebNN WebNN execution provider label Oct 23, 2025
@guschmue
Copy link
Contributor

/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@guschmue
Copy link
Contributor

/azp run MacOS CI Pipeline / iphone_simulator (arm64)

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ep:WebNN WebNN execution provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants