Skip to content

C++ Compiler API #1184

@tqchen

Description

@tqchen

Given that there is enough attention to the c++ compiler. I am creating this issue by elaborating the technical issues around this.

Benefit and Feasibility

Once we move everything to C++, we can expose the compiler API via PackedFunc to any front-end language we like. So everything still only depends on TVM's core C API but takes benefit of getting compiler support

This is definitely feasible, as the tvm and nnvm core are built up in C++. The python API themselves are C++ functions exposed to python.

This being said, we do take benefit of using python as a quick hook to access things like python callbacks and quick prototyping up things. So python API will continue to exist.

The general idea of migration is that we will move stable more part to C++, and expose them via PackedFunc. Contributions are welcomed. So far @alex-weaver has been championing this, and we would definitely interested in getting contributions.

Necessary Steps

  • Move basic version of tvm compiler API to c++ Port build_module.py to C++ #667
  • Move basic ops of topi to C++ Porting schedules (except convolutions) to C++ #763
  • Move nnvm registration of the basic topi operators to c++
    • This is easy as long as topi functions are in C++
    • They actually originally belong to C++ and we moved them to python for flexibility
  • Basic version of environment target system(like tvm.target), hopefully, compatible with python. this is needed for target-dependent dispatching when necessary.
  • NNVM build function.

These steps will get us a functional compiler. Note that we do not yet plan to move the convolution schedules officially to C++ as they are still in flux, but it is possible to port these directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions