I was bench-marking tvm and pytorch in terms of inference time and I see that tvm performance is almost 10x better than pytorch. I also compared predictions probability for each inference and it almost matches between tvm and pytorch. The inference time results looks very suspicious for me and I couldn’t figure out any issue in the my code. I thought it would be better to get tvm experts opinion on this.
Is it really possible to get this performance in tvm or something wrong in my code ?
Here is the inference time results in ms with different batch-size(bs)
1bs 8bs 16bs 32bs 64bs
pytorch 5.038ms 0.7796ms 0.3248ms 0.1513ms 0.0786ms
TVM 0.1976ms 0.0204ms 0.0099ms 0.0051ms 0.0025ms
I have shared my code here https://github.com/manojec054/tvm-explore/blob/master/tvm_explore.py
Dataset : Animal classification with 3 classes
Image size : 224, 224
tvm version : 0.9.dev0