flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

How to get around max size of 2GB for very big sequential objects?

Open machineko opened this issue 2 years ago • 3 comments

I have pretty average neural network (10GB) and small exporter using flatbuffers how do i "fight" int32 offset limit in python, it is even possible or i have to switch to protobuf for that use case?

machineko avatar Jul 22 '22 09:07 machineko

There isn't a good way around it. Our size limits are generally set by constants (which you could modify in a branch) but that will limit the portability of your flatbuffer.

Note that protobuf also has a 2GB size limit

CasperN avatar Jul 22 '22 20:07 CasperN

could you point me to places when i have to modify size limit?

machineko avatar Jul 23 '22 10:07 machineko

Just look for UOffset and SOffset in the repo. I'm going to warn you that this path isn't tested/supported, so if it doesn't work first try, then some code somewhere assumes the size of these types without referring to them which will be a huge pain to track down. That said, someone have done it before as alluded to in #4505

CasperN avatar Jul 23 '22 14:07 CasperN

Going to close since it is not directly actionable, and we already track 2 GB limit elsewhere.

dbaileychess avatar Aug 09 '22 01:08 dbaileychess