Hi,
I’m a TVM newbie and I want to ask two questions:
I now have a PyTorch model, which can be compiled into a mod Relay IR through TVM, and I know that we can now complete forward inference through this Relay IR.
My question is: Suppose we have an input(x,y), and the value of loss, loss(y,mod(x)).
1, Can I obtain the gradient of the parameters in the mod and the gradient of x through the value of this loss? Because Backpropagation actually calculates partial derivatives for x and model parameters respectively. I think that if we can get the gradient of loss to x, it will be helpful for many applications. 2 Am I able to update my mod IR with the gradient of the obtained parameters? That is TVM training.
Can you provide me with a simple code example?
Thanks in advance!