Recently we implemented an infrastructure for implementing MXNet operators by TVM ( https://github.com/apache/incubator-mxnet/pull/15550 ) One missing feature is “add_to” semantic for backward operation, https://github.com/apache/incubator-mxnet/blob/master/include/mxnet/op_attr_types.h#L57
We have two possible approaches,
- Bind output and input to the same buffer, e.g.,
C = compute(A, B)
we introduce another input placeholder C_temp
C = C_temp + compute(A, B)
and bind C and C_temp to the same buffer
Pros: no need to change TVM
Cons:
- Hard to understand
- question: Can it describe all cases?
- C = tvm.compute(…, mode=“add_to”)
In codegen, we replaceC = ...
byC += ...
What do you think? @reminisce @junrushao @tqchen