Skip to main content

Tinyverse Platform overview

Tinyverse is an open platform for containerizing, shipping and running TinyML applications. Rune decouples your ML application from the underlying hardware. Using Rune you can build, test and deploy your ML models faster to a variety of end devices.

The Tinyverse platform#

The Rune platform provides the ability for Machine Learning Engineers/Application package and run TinyML applications (called a Rune) in a Virtual Machine on various hardware. The isolation and security of a Rune app is accomplished by using a capability based mechanism.

Rune files are specialized bytecode (wasm) that can be deployed to various hardware targets and contains both the model and the code required to process signals to features for the model. As such the Rune are tiny and only contain exactly what is needed. You can easily share your Rune for development, testing and deployments.

Tinyverse provides tooling to manage the lifecycle of your Runes:

  • rune-cli to build and run your Rune
  • rune-vm a virtual machine spec implemented in a variety C++/Rust/JS & Flutter
  • hammrd a daemon service to help privately collect labelled data for your projects

Tinyverse architecture and components#

Rune and Hammer use a client-server architecture. The rune-vm runs on your target device and executes and manages the rune. Additionally, using the hammerd daemon allows you to collect labelled data directly from the clients. The rune-vm and hammrd daemon can run on the same system, or you can connect a rune-vm to a remote Hammer daemon.

Runes can be directly embedded into your hardware or updated by the hammerd.

Tinyverse Components

Rune Images#

Rune is an orchestration tool for specifying how data should be processed, with an emphasis on the machine learning world, in a way which is portable and robust.

The main purpose of a Rune is to give developers in the fields of machine learning and data processing a way to declare how data should be transformed using a high level, declarative language.

Instead of needing to write code that manipulates data or needs to interface with complex third party libraries for receiving inputs, you write a Runefile which declares each processing step and defers their implementation to the rune-vm. This rune-vm runtime then takes care of interfacing with the outside world and can leverage existing third party libraries for data manipulation.

Example Rune run command#

The following command runs an sine rune, attaches interactively to your local command-line session, and runs an inference to predict the sine of random numbers.

Sine Runefile#

FROM runicos/base
PROC_BLOCK<F32,F32> mod360 hotg-ai/rune#proc_blocks/modulo --modulus 360.0
MODEL<F32, F32> sine ./sinemodel.tflite
OUT serial
RUN rand mod360 sine serial

Using the above Runefile we will build a Rune that takes in random floating points provided by the host's random number generator.

$ rune build examples/sine/Runefile
$ rune run examples/sine/sine.rune
[INFO] Running rune: examples/sine/sine.rune
[INFO] Serial: {"type_name":"f32","channel":2,"elements":[0.486],"dimensions":[1]}

When you run these commands, the following happens (assuming you are using the default registry configuration):

  1. Rune reads the Runefile and builds a sine.rune file in your folder. This sine.rune file is your image.

  2. Rune build also prepares the sine tflite model into your Rune. Rune also fetchs and packages processing blocks into the sine.rune. It will fetch hotg-ai/rune#proc_blocks/modulo from repo and in the proc_block/modulo folder. You can also define custom processing blocks that can be called during this process.

  3. During Rune run process, the sine.rune image is loaded and the VM makes a request to the host for access to the RAND capability. The host can then provide floating points and the input is process and prepared for the model.

The underlying technology#

Rune & Hammerd is written in the Rust programming language and takes advantage of several features of the Webassembly platform to deliver its functionality.

Next steps#