Skip to content

Commit d91193d

Browse files
Prakalp Srivastavatensorflower-gardener
authored andcommitted
Increase constant fold policy size threshold.
To accommodate some of the failing tests, increase the size threshold of constant fold policy from 128 KB to 256 KB. PiperOrigin-RevId: 320853763 Change-Id: I68f905a0236cc0923c28bd9bf182f35beb72f36b
1 parent f698419 commit d91193d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tensorflow/compiler/mlir/tensorflow/tests/constant-fold.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ func @DontRemoveTrivialMul(%arg0: tensor<1x6x8x1xf32>) -> tensor<1x6x8x1xf32> {
443443
// CHECK: return %[[RESULT]] : tensor<1x6x8x1xf32>
444444
}
445445

446-
// Do not fold if total result size is large (>128 KB) and more than 2 times
446+
// Do not fold if total result size is large (>256 KB) and more than 2 times
447447
// the size of operands.
448448

449449
// LINT.IfChange(folding-policy-test)

tensorflow/compiler/mlir/tensorflow/transforms/constant_fold.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace TF {
4040
// LINT.IfChange(folding-policy)
4141
static bool ShouldBeFolded(Operation* inst) {
4242
constexpr int kSizeFactor = 2;
43-
constexpr int64_t kSizeThreshold = (1 << 20); // 128 KB
43+
constexpr int64_t kSizeThreshold = (1 << 21); // 256 KB
4444
bool has_unknown_shape = false;
4545
auto get_size = [&](TypeRange types) {
4646
int64_t size = 0;

0 commit comments

Comments
 (0)