-
Notifications
You must be signed in to change notification settings - Fork 72
[torchlib] Fix layer norm dtype #2100
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
Conversation
Fix layer norm dtype mismatch errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a layer normalization datatype mismatch error by updating how constants are created for weight initialization and removing an unnecessary helper function.
- Updated weight initialization to ensure that the constant matches the input tensor’s dtype.
- Removed the bias initialization block and the auxiliary _aten_layer_norm_onnx function, directly calling op.LayerNormalization.
Comments suppressed due to low confidence (1)
onnxscript/function_libs/torch_lib/ops/core.py:4755
- The bias initialization block was removed, so if bias is None, op.LayerNormalization will receive None. Please verify that passing None for bias is acceptable or provide a suitable default.
result, _, _ = op.LayerNormalization(input, weight, bias, axis=axis, epsilon=eps)
❌ 3 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Fix layer norm dtype mismatch errors
Fixes #2099