tvm icon indicating copy to clipboard operation
tvm copied to clipboard

Making python schedules available to C++

Open alex-weaver opened this issue 8 years ago • 3 comments

It looks like many of the schedules in TOPI are implemented with python - what would be the best way to make these available to C++? They could be ported directly but that would increase maintenance work - is there a way to make schedules serializable?

alex-weaver avatar Jan 02 '18 18:01 alex-weaver

python is mainly for quick prototyping purpose. Once we have a clear idea about what they should look like, we can start port most of them to C++, and just call the c++ function from python side.

Currently, I feel that most operators except for those convolutions can already be safely ported to c++

tqchen avatar Jan 04 '18 03:01 tqchen

Ok that makes sense. I'm interested in contributing to this - looking over the TOPI code I have one question: I can't see any C++ equivalent to the target.generic_func annotation for picking target-specific specializations. How should this be handled in C++ ops?

alex-weaver avatar Jan 04 '18 13:01 alex-weaver

I need to put more thought into how to define proper target and dispatching system in c++. In the meanwhile, most of the declaration(except for conv2d) are target generic.

The target-specific schedule functions can also be readily added and the topi can work by calling topi::cuda::schedule_conv2d

The generic dispatching system could be an addition to these afterwards

tqchen avatar Jan 05 '18 05:01 tqchen