You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] layer_norm should support broadcast in all axes #20802
I reproduced the importer failure with the Windows x64 apache-tvm==0.27.0.post1 wheel and ONNX 1.23.2, using explicitly constructed models rather than the serialized example.
For X=[2,3,5], axis=1, the [3,5] Scale/B control imports, while [3,1] Scale/B is rejected by the Relax layer_norm parameter-shape check. Separate cases with a trailing vector, scalar affine parameters, independently broadcastable Scale/B, batch-dependent parameters, omitted bias, and axis=-2 are also rejected. All eight models pass ONNX full checking and strict shape inference, and ONNX ReferenceEvaluator matches a NumPy oracle. This checks TVM import behavior; I have not compiled/executed these models with TVM.
The current frontend also requires Scale/B to have identical shapes, although ONNX allows each to broadcast independently. A frontend-only follow-up could preserve the existing Relax operator contract; broadcasting only to the normalized suffix would fix the reported shape but would not cover batch-dependent affine parameters.
I noticed #20510 is already updating this converter's normalization axes and optional outputs. I have not started a competing implementation. Would a separate broadcast follow-up after that PR be useful, or is this intended to be included in its scope?
Disclosure: this reproduction and source analysis were performed with AI assistance (OpenAI Codex).
Activity
xgbtxy commentedon Oct 20, 2026
I reproduced the importer failure with the Windows x64
apache-tvm==0.27.0.post1wheel and ONNX 1.23.2, using explicitly constructed models rather than the serialized example.For
X=[2,3,5],axis=1, the[3,5]Scale/B control imports, while[3,1]Scale/B is rejected by the Relaxlayer_normparameter-shape check. Separate cases with a trailing vector, scalar affine parameters, independently broadcastable Scale/B, batch-dependent parameters, omitted bias, andaxis=-2are also rejected. All eight models pass ONNX full checking and strict shape inference, and ONNX ReferenceEvaluator matches a NumPy oracle. This checks TVM import behavior; I have not compiled/executed these models with TVM.The current frontend also requires Scale/B to have identical shapes, although ONNX allows each to broadcast independently. A frontend-only follow-up could preserve the existing Relax operator contract; broadcasting only to the normalized suffix would fix the reported shape but would not cover batch-dependent affine parameters.
I noticed #20510 is already updating this converter's normalization axes and optional outputs. I have not started a competing implementation. Would a separate broadcast follow-up after that PR be useful, or is this intended to be included in its scope?
Disclosure: this reproduction and source analysis were performed with AI assistance (OpenAI Codex).