Re-land: Optimize dot(DynamicSlice(ConstA), ConstantB) by memoizing dot(ConstA, ConstB)
authorAlina Sbirlea <asbirlea@google.com>
Tue, 8 May 2018 18:54:03 +0000 (11:54 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Tue, 8 May 2018 22:42:09 +0000 (15:42 -0700)
commit59bffb7051231c7e0f8020892db8c3d584c555f4
treee485a0cfb02265a8eb04411874c9bd695183839e
parent4f7a0bc8c11827dde6986ad29e9fd21c48597367
Re-land: Optimize dot(DynamicSlice(ConstA), ConstantB) by memoizing dot(ConstA, ConstB)

Make transformation when ConstA and ConstB are 2D, and DynamicSlice is slicing a full row, column respectively.
Handle:
dot(DynamicSlice(Index, ConstA), ConstB) => DynamicSlice(Index, dot*(ConstA, ConstB));
and
dot(ConstA, DynamicSlice(Index, ConstB)) => DynamicSlice(Index, dot*(ConstA, ConstB));

Reason to roll forward: Previous issue of getting out of memory errors when generating LLVM constants was resolved by CSE-ing constants before allocation.

PiperOrigin-RevId: 195853680
tensorflow/compiler/xla/service/algebraic_simplifier.cc
tensorflow/compiler/xla/service/algebraic_simplifier_test.cc
tensorflow/compiler/xla/tests/dot_operation_test.cc