Notes on Serialization

Treelite model objects can be serialized into two ways:

  • Python Buffer Protocol, to enable zero-copy serialization in the Python programming environment. When pickling a Python object containing a Treelite model object, we can convert the Treelite model into a byte sequence without physically making copies in memory.

  • Files. Tree models can be converted into Treelite checkpoint files that can be later read back.

We make certain guarantees about compatiblity of serialization. It is possible to exchange serialized tree models between two different Treelite versions, as follows:

To: =2.4

To: =3.0

To: >=3.1,<4.0

To: >=4.0

From: <2.4

From: =2.4

From: =3.0

From: >=3.1,<4.0

From: >=4.0