Skip to content

Commit

Permalink
test(memory_arena_threshold): adjust expected value with compression
Browse files Browse the repository at this point in the history
Fix a test failure by setting a different expected value for the
persistent buffer allocation when compression is configured in. The
allocation was allowed to vary by 3%; however, compression adds ~10%.
Set the expected value to the measured value when compression is
configured in.
  • Loading branch information
rkuester committed Oct 16, 2024
1 parent 01bc582 commit 5a02e30
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tensorflow/lite/micro/memory_arena_threshold_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ constexpr int kKeywordModelOnlyTotalSize = 14936;
// TODO(b/207157610): replace magic number that depends on OPs
constexpr int kKeywordModelOnlyTailSize = 14264;
constexpr int kKeywordModelPersistentTfLiteTensorDataSize = 224;
constexpr int kKeywordModelPersistentBufferDataSize = 840;
#endif
constexpr int kKeywordModelHeadSize = 672;
constexpr int kKeywordModelTfLiteTensorVariableBufferDataSize = 10240;
Expand All @@ -87,6 +86,15 @@ uint8_t test_conv_tensor_arena[kTestConvModelArenaSize];
constexpr int kTestConvModelTensorCount = 15;
constexpr int kTestConvModelNodeAndRegistrationCount = 7;

constexpr int kKeywordModelPersistentBufferDataSize =
#if defined(TF_LITE_STATIC_MEMORY)
832;
#elif defined(USE_TFLM_COMPRESSION)
920;
#else
840;
#endif

// NOTE: These values are measured on x86-64:
// TODO(b/158651472): Consider auditing these values on non-64 bit systems.
#ifdef TF_LITE_STATIC_MEMORY
Expand Down

0 comments on commit 5a02e30

Please sign in to comment.