We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From #14447 (comment)
Lets' do some performance experiments with
input:
Input [N, L, D] -> (decomposed) LayerNorm [N, L, D]
output
Input [N, L, D] -> Transpose [N, D, L] -> Reshape [N, 1, D, L] -> InstanceNorm [N, 1, D, L] -> Reshape [N, D, L] -> Transpose [N, L, D]
with our NPU backend
What to do (with draft)
CircleLayerNorm
CircleInstanceNorm
Transpose
Reshape
The text was updated successfully, but these errors were encountered:
pytorch source
import onnx import torch import torch.nn as nn class LayerNormNet(nn.Module): def __init__(self): super().__init__() self.ln = nn.LayerNorm((4)) def forward(self, x): out = self.ln(x) return out net = LayerNormNet() inp = torch.randn(1, 16, 4) torch.onnx.export(net, inp, "ln11.onnx", opset_version=11) onnx.shape_inference.infer_shapes_path('ln11.onnx', 'ln11-si.onnx') torch.onnx.export(net, inp, "ln17.onnx", opset_version=17) onnx.shape_inference.infer_shapes_path('ln17.onnx', 'ln17-si.onnx')
use ln11-si.onnx
ln11-si.onnx
Sorry, something went wrong.
circle model
Instance norm with 2 x Transpose + 2 x Reshape uses more cycles than decomposed LayerNorm. Doesn't look worth adding this transformation.
Instance
2 x Transpose
2 x Reshape
ref internal ONE/issues/127
ONE/issues/127
No branches or pull requests
From #14447 (comment)
Lets' do some performance experiments with
input:
output
with our NPU backend
What to do (with draft)
CircleLayerNorm
virtual IRCircleLayerNorm
CircleInstanceNorm
withTranspose
+Reshape
The text was updated successfully, but these errors were encountered: