pytorch / tvm

TVM integration into PyTorch
452 stars 64 forks source link

Switch to nearbyint instead of using round, which costs performance. #125

Closed kimishpatel closed 5 years ago

kimishpatel commented 5 years ago

Performance loss comes from the fact that llvm does a function call to 'roundf' whereas replacing that with nearbyint just replaces the call with a couple of scale and round instructions.

kimishpatel commented 5 years ago

Thanks for quick approval @yinghai. Yes accuracy wise it stays the same.