NNVM Intermediate Representation

NNVM is a reusable graph Intermediate Representation stack for deep learning systems. It provides useful API to construct, represent and transform computation graphs to get most high-level optimization needed in deep learning. NNVM is a part of TVM stack for deep learning and provides a shared compiler for deep learning frameworks to optimize, compile and deploy into different hardware backends through TVM.

Key requirements

The key requirements of NNVM considering the goal of TVM Stack are:

Have minimum dependency in the deployment module

Being able to add new operators to the IR in a decentralized fashion

Being able to add new optimization passes to the IR and applies to existing graphs

Key elements

The key elements of NNVM are:

Operator registry system to register and add new operators

Operator attribute system provide property of operator in decentralized fashion

A reusable IR data structure for optimization passes

This design allows the NNVM compiler to be directly used as optimization and compilation stack for frameworks. The extendible nature of NNVM makes new adjustment easy without constraining the backend providers.

Example of NNVM Intermediate Representation

This is how a ResNet18 model in NNVM IR (graph representation) looks like: