Files
pytorch/caffe2/python
Yuchen Hao 4a751dfc20 optimize MulGradient for common shapes (#19705)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19705

Optimizing for a case when there's a consecutive dims that are not broadcasted followed by another consecutive dims that are broadcasted.
For example, MulGradient(["dC", "A", "B"], ["dA", "dB"], broadcast=True, axis=0) where A.shape == dC.shape == [9508, 80] and B.shape == [80] .

Test Plan:
In SKL T6,

Running mul_gradient_benchmark without this optimization
Operator #0 (dA, MulGradient) 11.9119 ms/iter

After this optimization,
Operator #0 (dA, MulGradient) 0.672759 ms/iter

Need to land D15291800 before to fix the unit test error

Reviewed By: dmudiger

Differential Revision: D15075415

fbshipit-source-id: 0f97be17cf8f1dacbafa34cd637fb8bc1c5e5387
2019-12-11 11:39:52 -08:00
..
2019-11-08 10:39:17 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-11-01 12:53:01 -07:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-09-13 11:38:14 -07:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-06-13 15:21:55 -07:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-11-18 15:22:37 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00
2019-12-02 20:17:42 -08:00