-
Notifications
You must be signed in to change notification settings - Fork 980
[Dep] Upgraded Flatbuffer to 25.9.23 #3296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,7 +135,7 @@ TF_LITE_MICRO_TEST(IfShouldInvokeSubgraphConditionTrue) { | |
| } | ||
|
|
||
| TF_LITE_MICRO_TEST(IfShouldInvokeSubgraphConditionFalse) { | ||
| constexpr int kArenaSize = 5000; | ||
| constexpr int kArenaSize = 16384; | ||
| uint8_t arena[kArenaSize]; | ||
|
|
||
| const tflite::Model* model = | ||
|
|
@@ -163,7 +163,7 @@ TF_LITE_MICRO_TEST(IfShouldInvokeSubgraphConditionFalse) { | |
| } | ||
|
|
||
| TF_LITE_MICRO_TEST(IfShouldNotOverwriteTensorAcrossSubgraphs) { | ||
| constexpr int kArenaSize = 5000; | ||
| constexpr int kArenaSize = 16384; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @veblush Same as line 138 question |
||
| uint8_t arena[kArenaSize]; | ||
|
|
||
| const tflite::Model* model = | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,7 @@ TF_LITE_MICRO_TEST(TestSingleSubgraphWithIntermediates) { | |
| } | ||
|
|
||
| TF_LITE_MICRO_TEST(TestMultiSubgraphWithIf) { | ||
| constexpr int kArenaSize = 1024; | ||
| constexpr int kArenaSize = 2048; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @veblush Did the updated flatbuffers library cause the model schema to expand in size? |
||
| uint8_t arena[kArenaSize]; | ||
| const tflite::Model* model = | ||
| tflite::testing::GetSimpleModelWithSubgraphsAndIf(); | ||
|
|
@@ -114,7 +114,7 @@ TF_LITE_MICRO_TEST(TestMultiSubgraphWithIf) { | |
| } | ||
|
|
||
| TF_LITE_MICRO_TEST(TestMultiSubgraphWithIfAndEmptySubgraph) { | ||
| constexpr int kArenaSize = 1024; | ||
| constexpr int kArenaSize = 2048; | ||
| uint8_t arena[kArenaSize]; | ||
| const tflite::Model* model = | ||
| tflite::testing::GetSimpleModelWithIfAndEmptySubgraph(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,7 +69,7 @@ class StackAllocator : public flatbuffers::Allocator { | |
| return *inst; | ||
| } | ||
|
|
||
| static constexpr size_t kStackAllocatorSize = 8192; | ||
| static constexpr size_t kStackAllocatorSize = 64 * 1024; | ||
|
|
||
| private: | ||
| uint8_t data_backing_[kStackAllocatorSize]; | ||
|
|
@@ -80,12 +80,9 @@ class StackAllocator : public flatbuffers::Allocator { | |
| }; | ||
|
|
||
| flatbuffers::FlatBufferBuilder* BuilderInstance() { | ||
| static char inst_memory[sizeof(flatbuffers::FlatBufferBuilder)]; | ||
| static flatbuffers::FlatBufferBuilder* inst = | ||
| new (inst_memory) flatbuffers::FlatBufferBuilder( | ||
| StackAllocator::kStackAllocatorSize, | ||
| &StackAllocator::instance(MicroArenaBufferAlignment())); | ||
| return inst; | ||
| return new flatbuffers::FlatBufferBuilder( | ||
| 1024, | ||
| &StackAllocator::instance(MicroArenaBufferAlignment())); | ||
| } | ||
|
|
||
| // A wrapper around FlatBuffer API to help build model easily. | ||
|
|
@@ -1939,10 +1936,9 @@ const Model* GetNoOpModelWithTensorShape( | |
| const Tensor* Create1dFlatbufferTensor(int size, bool is_variable) { | ||
| using flatbuffers::Offset; | ||
| flatbuffers::FlatBufferBuilder* builder = BuilderInstance(); | ||
| constexpr size_t tensor_shape_size = 1; | ||
| const int32_t tensor_shape[tensor_shape_size] = {size}; | ||
| std::vector<int32_t> shape = {size}; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @veblush will the verboten std::vector port to non x86 platforms? |
||
| const Offset<Tensor> tensor_offset = CreateTensor( | ||
| *builder, builder->CreateVector(tensor_shape, tensor_shape_size), | ||
| *builder, builder->CreateVector(shape), | ||
| TensorType_INT32, 0, builder->CreateString("test_tensor"), 0, | ||
| is_variable); | ||
| builder->Finish(tensor_offset); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@veblush Thats a big increase in arena size. Any ideas why this expansion happened?