未验证 提交 7a3d05d9 编写于 作者: L limingshu 提交者: GitHub

Optimization for layerNormGrad [Part1] (#51282)

* first commit

* fix code bugs in for_loop

* fix bugs in cuLoadAddStridedInputs.

* optimization for LayerNormBackwardComputeGradInput

* add unitest for validating the optimization

* fix windows ci error
上级 e4ba5f86
......@@ -265,8 +265,8 @@ class TestLayerNormOp(unittest.TestCase):
test_with_place(place, shape, begin_norm_axis)
def test_check_forward_backward_with_scale_and_bias(self):
self.check_forward_backward(shape=[1, 3, 4, 5], begin_norm_axis=1)
self.check_forward_backward(shape=[2, 3, 4, 5], begin_norm_axis=1)
self.check_forward_backward(shape=[1, 3, 4, 5], begin_norm_axis=1)
self.check_forward_backward(
shape=[2, 3, 4, 5],
begin_norm_axis=1,
......@@ -290,6 +290,7 @@ class TestLayerNormOp(unittest.TestCase):
shape=[92, 513, 129], begin_norm_axis=2, y_grad_scale=0.1
)
self.check_forward_backward(shape=[3, 34, 1134], begin_norm_axis=2)
self.check_forward_backward(shape=[3, 2, 1133], begin_norm_axis=2)
self.check_forward_backward(
shape=[92, 513, 1134], begin_norm_axis=2, y_grad_scale=0.1
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册