-
Notifications
You must be signed in to change notification settings - Fork 713
Commit c5fe1c6
committed
Update on "[ET][Portable][Build Size] Move to elementwise_utils as apply_tritensor_elementwise_fn"
swolchok's technique is superior to the TensorReader/TensorWriter approach I introduced in D63703174. So, I am rewriting my build size reduction stack on top of his approach.
Superior how?
- It should lead to smaller overall build size. Current measurements indicate this. Complete data will be published after the stack is complete.
- It is better suited for dtype selective build, since it passes the op name to all of the ET_SWITCHes involved.
- It is more performant. Current measurements to clamp.Tensor_out indicate this. Note that in the data below, my stack is marginally more performant for the vanilla case (no broadcast & all dtypes equal), but this is only because I added a "fast path" in my code for such vanilla case, which can be trivially added to Scott's approach as well. It is more relevant to compare numbers for mixed dtype or broadcasting.
```
Baseline
clamp.Tensor_out no broadcast float: 25451 [23423 - 28839] microseconds
clamp.Tensor_out no broadcast double: 25461 [23377 - 50940] microseconds
clamp.Tensor_out no broadcast mixed dtype: 23367 [21353 - 27022] microseconds
clamp.Tensor_out broadcast: 702529 [679667 - 742005] microseconds
Manuel C
clamp.Tensor_out no broadcast float: 22919 [21333 - 27140] microseconds
clamp.Tensor_out no broadcast double: 23095 [21472 - 27462] microseconds
clamp.Tensor_out no broadcast mixed dtype: 35042 [32875 - 42491] microseconds
clamp.Tensor_out broadcast: 936541 [916437 - 971499] microseconds
Scott W
clamp.Tensor_out no broadcast float: 28263 [26458 - 32832] microseconds
clamp.Tensor_out no broadcast double: 27442 [25548 - 39417] microseconds
clamp.Tensor_out no broadcast mixed dtype: 25592 [23620 - 30148] microseconds
clamp.Tensor_out broadcast: 695399 [674244 - 738919] microseconds
```
Build size reduction after Scott's diffs touching clamp.Tensor_out and where.self_out:
- clamp: 7.42 MB -> 119 KB
- where: 106 KB -> 16 KB
Differential Revision: [D63838072](https://our.internmc.facebook.com/intern/diff/D63838072/)
[ghstack-poisoned]1 parent 3bc3c68 commit c5fe1c6Copy full SHA for c5fe1c6
File tree
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedOpen diff view settings
Filter options
Expand file treeCollapse file tree
0 file changed
+0
-0
lines changedOpen diff view settings
0 commit comments