-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
ONNX spec states "Scale tensor shape should be broadcastable to the normalized shape," which should mean a scalar weight should be acceptable as the scale input. ORT rejects this input with error
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running RMSNormalization node. Name:'node_rms_norm' Status Message: Size of scale and bias (if provided) must match X.shape[axis:], or scale and bias (with same shape) can be broadcasted to X when axis is 2. X.shape={2,5,3} scale.shape={} bias.shape={} and axis=2
Ref:
| : LayerNormImpl(op_kernel_info, /* simplified */ true) {} |
Ref:
| if (params.broadcast_param == kLayerNormInvalidInput) { |
Also @gramalingam : would it be a good idea to make scale optional? We can do a batch update on the normalization ops to make scale and bias optional in opset 25: onnx/onnx#6552