TFLite memory mapped IO

TFLite stores the embeddings of its model as a FlatBuffer, utilizing memory-mapped I/O. I would like to understand the reasons why FlatBuffers are well-suited for memory-mapped I/O.

To my knowledge, the size of the embedding table is considered negligible because TFLite employs memory-mapped I/O for embeddings.

Hi @rita19991020,

FlatBuffers support binary serialization format, which is inherently more efficient for memory-mapped I/O compared to text-based formats like JSON or XML . FlatBuffers are also suitable for use with mmap (or streaming), requiring only part of the buffer to be in memory. As Flatbuffers are suitable for sharing data across platforms with different byte orders, these are suitable for memory-mapped I/O. As you mentioned, Faltbuffers produces tiny code foot prints. Please go through the documentation for additional information.

Thank You