[Discussion/Alignment] Memory Planning

My proposal is now implemented.

I ended up completely replacing the content of graph_plan_memory.cc with a python implementation:

To work with the data-flow graph more conveniently this adds networkx as dependency. For the optimal solution, this would drag in the optimizer OR-Tools as well. The code is currently also pretty filled with debug functionality that might not be wanted by TVM.

How to contribute this back?

First results are shown below. This is evaluated on RISC-V and using the code generator. There still might be some issue, because I would not expect the RAM usage to rise in any example. But looks promising so far with 10% reduction for a cifar10 model and 18% for resnet!

1 Like