Skip to content

Commit 268d3b3

Browse files
navahgarfacebook-github-bot
authored andcommitted
[Static Runtime] Use composite op for TE fusion (#74126)
Summary: Pull Request resolved: #74126 When we perform fusion without the composite op, `TensorExprDynamicGroup`, it ends up not reusing the output tensor buffers. So, until we figure out a way to do that with `TensorExprGroup` op, it seems strictly better to use composite op, even though it involves going to the JIT. ghstack-source-id: 151191941 Test Plan: Tested locally with `ptvsc2_predictor_bench` on the Video model. Performance analysis with `caffe2/caffe2/fb/predictor/bench:limb` on the Video model locally showed an improvement of ~1% with this change. Reviewed By: mikeiovine Differential Revision: D34831280 fbshipit-source-id: e523878364b519ccd51b78d52d9f6c9d3e8def17
1 parent cf53785 commit 268d3b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/csrc/jit/runtime/static/fusion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ void performTensorExprFusion(
345345
FuseTensorExprs(
346346
traced_graph,
347347
/*min_group_size*/ 2,
348-
/*add_composed_op*/ false,
348+
/*add_composed_op*/ true,
349349
/*fuse_to_dynamic_shapes*/ true);
350350
inlineFallbackGraphs(traced_graph);
351351
graph->block()->clear();

0 commit comments

Comments
 (0)