Deep Learning in Rust

github build status GitHub stars

Introduction

Building Deep Learning algorithms is paramount for doing Data Science in Rust. In this post, I show how:

  • Rust can support GPU.
  • Rust can provide superior performance than Python and by how much.
  • Good and bad use case for Deep Learning in Rust.

State of the art of Deep Learning in Rust

Deep Learning in the Rust ecosystem is spread between native libraries like linfa and C++ binding of common libraries like Tensorflow, Pytorch and Onnxruntime.

I have found onnxruntime-rs to be a convenient crate for DL offering:

  • the ability to load sklearn, tensorflow and pytorch model.
  • superior performance than native Pytorch or Tensorflow.
  • a small bundle size ~30Mb compared to tch-rs 1.2 Gb bundle.

➡️ this post is therefore going to be based on onnxruntime-rs.


This blog was originally published here: https://able.bio/haixuanTao/deep-learning-in-rust-with-gpu--26c53a7f