Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LayerNormalization Operator] Why LayerNormalization do not support weight and bias auto broadcast. #18184

Closed
triple-Mu opened this issue Oct 31, 2023 · 3 comments
Labels
core runtime issues related to core runtime stale issues that have not been addressed in a while; categorized by a bot

Comments

@triple-Mu
Copy link

Describe the issue

Input is [1, 16, 256, 256]
I want to do layernorm in axes 1 and the weight and bias shape is [1, 16, 1, 1].
It will broadcast to [1, 16, 256, 256].
But the error is:

onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running LayerNormalization node. Name:'/LayerNormalization' Status Message: Size of X.shape()[axis:] == 1048576. Size of scale and bias (if provided) must match this. Got scale size of 16 and bias size of 16

So what can i do?

To reproduce

2023-10-31_13-45

Urgency

No response

Platform

Linux

OS Version

ubuntu 20.04

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.16.0

ONNX Runtime API

Python

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

cpu

Model File

No response

Is this a quantized model?

No

@yuslepukhin yuslepukhin added the core runtime issues related to core runtime label Oct 31, 2023
@tianleiwu
Copy link
Contributor

It's valid case according to onnx spec This operator supports unidirectional broadcasting (tensors Scale and B should be unidirectional broadcastable to tensor X).

ORT does not support it yet since the original implementation for ms domain (before the operator added to onnx domain) does not support broadcasting.

Copy link
Contributor

github-actions bot commented Dec 1, 2023

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Dec 1, 2023
Copy link
Contributor

github-actions bot commented Jan 1, 2024

This issue has been automatically closed due to inactivity. Please reactivate if further support is needed.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core runtime issues related to core runtime stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

3 participants