deeplearning4j / deeplearning4j

Suite of tools for deploying and training deep learning models using the JVM. Highlights include model import for keras, tensorflow, and onnx/pytorch, a modular and tiny c++ library for running math code and a java based math library on top of the core c++ library. Also includes samediff: a pytorch/tensorflow like library for running deep learn...
http://deeplearning4j.konduit.ai
Apache License 2.0
13.6k stars 3.83k forks source link

SameDiff: Implement new graph format (FlatBuffers storage problems to be resolved) #8312

Open AlexDBlack opened 4 years ago

AlexDBlack commented 4 years ago

We use FlatBuffers for storing SameDiff graphs. Here's some issues we need to solve with it (and our use there-of) going forward:

I would also like to clean up the format/fields, it has been built incrementally, and a lot has changed since it was created.

Alternatively, we look at ProtoBuf as the replacement here. But ProtoBuf may be less suitable for mobile than FlatBuffers.

Also: it turns out that FlatBuffers does support String/JSON format, which may be useful for our ops definitions, if we decided to go that way.


Edit 2020/05/05: As discussed internally.

Essentially, we want to implement a new format for SameDiff models that avoids some of the problems with the current format, and also allows for things like:

raver119 commented 4 years ago

Looks like Swift support is going to be added soon: https://github.com/google/flatbuffers/pull/5603

AlexDBlack commented 4 years ago

New design has been created and merged here: https://github.com/KonduitAI/deeplearning4j/pull/467 Now it's simply a case of implementing that design.