Raven Update #0

Also posted on X/Twitter

I've decided to start sharing weekly updates about Raven, OCaml's emerging ecosystem for machine learning and data science. My aim is to build more transparently and share my progress publicly, from now until at least the first official release.

These posts will document the work in progress, and upcoming milestones, giving updated on the roadmap for the release. I will also share insights into the design decisions, and overall vision for Raven.

Hope you'll enjoy following along!

Major Rewrite of Nx

A few weeks ago, I started a major rewrite of our foundational library, previously named ndarray, now renamed nx. The new design has a significantly simplified backend interface inspired by Tinygrad. In its current state, it has only 39 operations that backend need to implement, and similar to Tinygrad, no matmul, convolve, etc. The goal is to make it easier to implement backends and prepare nx for compatibility with Rune's upcoming Just-In-Time (JIT) compilation.

In the process, I've implemented 2D convolution functions on top of the new backend interface, so once the rewrite is complete, we should finally be able to run a demo of a convolution network for MNIST.

Additionally, this rewrite impacts Rune, our automatic differentiation and JIT compilation library. At its core, Rune is now simply an Nx backend that raises effects for each operation. Having made the backend interface more minimal, implementing transformations (grad, jit, vmap) in Rune is now much easier.

Early JIT Success

To validate our new design, I've started developing a JIT compiler within Rune. While full JIT support isn't planned for the first release, I'm excited to report that we're successfully executing simple functions on Metal GPUs through JIT!

This Week's Focus

The rewrite of nx is nearly complete and has been pushed to a next branch. However, many tests are currently failing, which brings us to this week's primary focus:

On another front, I've begun working on a website for Raven (in a www branch). The website will feature landing pages for each library, documentation, and API references.

Stay tuned for more updates next week!