News for hackers. Stuff that matters.
Re:Snips Uses Rust to Build an Embedded Voice Assistant by quadrature on Thursday February 22, 2018 @09:38AM (#16437788)
Great project, definitely a worthy goal. I know several people who are skeptical of voice assistants because they aren't fully on device.

The blog article was very lean on the technical details apart from some basics about rust's safety and portability features.

could you elaborate on where the gains from rust come into play ?, is your model built on a DL framework that is written in rust ?.

Re:Snips Uses Rust to Build an Embedded Voice Assistant by oulipo on Thursday February 22, 2018 @10:07AM (#16437994)
The DL framework is classical, but the models can then be reimplemented in pure Rust for efficiency
Re:Snips Uses Rust to Build an Embedded Voice Assistant by quadrature on Thursday February 22, 2018 @10:16AM (#16438076)
So you're taking the parameters from something like tensorflow and then exporting them to be executed in Rust ? and that is more efficient than the c++ backend of tensorflow ?.
Re:Snips Uses Rust to Build an Embedded Voice Assistant by oulipo on Thursday February 22, 2018 @12:07PM (#16439112)
It is useful for very small devices where you don't want to ship a bigger C++ lib
Re:Snips Uses Rust to Build an Embedded Voice Assistant by quadrature on Thursday February 22, 2018 @12:21PM (#16439245)
Neat, would be great to have a technical blog post on what your team has built. it sounds really interesting.
Re:Snips Uses Rust to Build an Embedded Voice Assistant by jodureau on Thursday February 22, 2018 @01:34PM (#16440029)
Hi! Keep an eye on our Medium: https://medium.com/snips-ai We have a few technical blog posts out there already, and a few more coming.
Re:Snips Uses Rust to Build an Embedded Voice Assistant by throwawayendy on Thursday February 22, 2018 @10:24AM (#16438127)
And also removing all of the overhead of the machine learning abstraction. Although I am skeptical that anyone would ever actually do that
Re:Snips Uses Rust to Build an Embedded Voice Assistant by danieldk on Thursday February 22, 2018 @02:14PM (#16440463)
I used to train my parser (before switching to Tensorflow) using Caffe, dumped the parameters using a small program, and loaded them up in Go arrays slices and applied the network using simple C BLAS operations. This works fine, especially when you are using simpler networks. As a bonus, you don't have the overhead of Tensorflow session runs.

It does become a bit of a drag when you are building more complex networks (e.g. with multiple RNN layers, batch normalization, etc.). In that case there are two straightforward options for Rust. There is a Tensorflow Rust binding against the tensorflow C API [1] with which you can just load and run a frozen Tensorflow graph. This is the approach that I am currently using, though I am running graphs on workstations/servers.

Another option is compiling the graph with Tensorflow's XLA AOT compilation, which compiles the network to C++ classes (that you could bind from Rust).

[1] https://github.com/tensorflow/rust

Re:Snips Uses Rust to Build an Embedded Voice Assistant by albi_lander on Friday February 23, 2018 @05:09AM (#16445373)
There seems to be a third option provided by someone, kali, working at Snips: https://github.com/kali/tensorflow-deploy-rust
Re:Snips Uses Rust to Build an Embedded Voice Assistant by danieldk on Saturday February 24, 2018 @01:23AM (#16452039)
This only supports a small subset of ops. It is pretty much corresponds to the first option that I mentioned - train with Tensorflow, extract the parameters and provide implemenations of ops in your native language.
Re:Snips Uses Rust to Build an Embedded Voice Assistant by quadrature on Thursday February 22, 2018 @10:46AM (#16438320)
Not exactly sure what you mean. After the model is trained there isn't much "machine learning abstraction".

you can serve the model using tensorflow serving using exported parameters. Its exactly what you want for serving the model.

Re:Snips Uses Rust to Build an Embedded Voice Assistant by tmzt on Thursday February 22, 2018 @04:14PM (#16441447)
have you seen RLSL? It's a subset of Rust targetting SPIR-V.

https://github.com/MaikKlein/rlsl