How to Test a Compiled Model in TVM After Conversion to Shared Object?

Hello everyone,

I’m currently working on a machine learning project where I need to deploy a pre-trained BERT model for sentiment analysis. Here’s a brief overview of what I’ve done so far:

  1. Downloaded and Fine-Tuned the Model: I successfully downloaded a pre-trained BERT model from Hugging Face and fine-tuned it on a custom dataset for binary sentiment classification (positive/negative).
  2. Compiled the Model Using TVM: After fine-tuning, I compiled the model using TVM, generating a shared object file (libmodel.so) to optimize inference performance on my CPU.

Now, I’m at the stage where I need to test this compiled model to ensure it works as expected before deploying it in a production environment.

Questions:

  1. Is the testing approach I’m using correct for ensuring that the compiled model functions properly?
  2. Are there any specific considerations I should keep in mind regarding input dimensions or preprocessing?
  3. What steps can I take to further validate the model’s predictions?
  4. How can test the model with the real word application?