Extend op dynamically

If TVM is released to customers as a dynamic library(like .so file), I wonder to know whether customers can extend their own operators dynamically?

I am not sure what you mean by “extend their own operators dynamically”.

I will try to respond with my personal opinion of how I think this could be done (i.e. haven’t tried it and since I have developed 0 lines of the TVM stack you should take my opinion with some grain of salt).

I am going to assume that the customer works via the python API (although this isn’t really necessary) and that the operators you mean are the NN operators like conv2d and other related operators.

I guess the frontend of the TVM stack (NNVM or Relay) wouldn’t really need modification. Nonetheless, I think with the register (as in register_node or register_func) methods available through the API, customers could enhance the operator library and the routines (including custom ir_pass) which handle them to fit their needs.

Now for the TVM (as in the language/IR) side, nothing stops the customers from overwriting the default computes and schedules with their own implementation (if you need some evidence of this look at the VTA code, although technically I guess you can also see at the schedules of each backend to see something similar). Again including ir_pass here is also possible if needed.

So at least defining new operators (at different levels of the stack) and processing (compiling) them is in my opinion completely viable.

The other stuff which is also TVM (like for example the runtime), that IDK if it would be as easily extended (but I might be wrong).

Hopes this helps

thank you very very much for your patient and detailed answer~~