On-the-fly weight validation with TVM

Hello,

I’m a TVM newbie considering using this tool for a research project. At a high level, I want to transform an existing model into a model that will verify its own parameters at runtime. I have a few questions about this:

  • When representing a model in the Python API, I believe the different layers are represented by calls like “nn.conv2d” to functions in tvm/topi/nn/*. Is there a “nice” way to swap out calls to these functions to my own custom functions (with similar parameters) given a pre-trained model?
  • For performance, I’d like to forward inputs through the layer and validate the weights in parallel - how should I go about doing this?
  • How could I go about modifying a layer’s weights (both the values and the shapes)?
  • How could I raise a runtime exception in the event that weight validation fails?

Thanks!