I have a PyTorch model I want to run in the browser.
From what little I've been able to understand, there are a few different ways of handling this, but none are all that great: Onnx.js is somewhat stale and missing many PyTorch operators, Tensorflow.js works great but requires either porting to TF or doing multiple conversions (PT -> Onnx -> TF), and then there is TVM which sent me down this rabbit-hole of deep learning compilation. It seems possible to use TVM's IR to compile PyTorch (along with many other frameworks) into Wasm or WebGPU. Haven't tried yet, but this domain is fascinating!
1 comment
[ 3.3 ms ] story [ 14.6 ms ] threadFrom what little I've been able to understand, there are a few different ways of handling this, but none are all that great: Onnx.js is somewhat stale and missing many PyTorch operators, Tensorflow.js works great but requires either porting to TF or doing multiple conversions (PT -> Onnx -> TF), and then there is TVM which sent me down this rabbit-hole of deep learning compilation. It seems possible to use TVM's IR to compile PyTorch (along with many other frameworks) into Wasm or WebGPU. Haven't tried yet, but this domain is fascinating!