Scale By The Bay 2020: Ryan Orendorff & Daniel Hensley, Programming machine learning algorithms...
ai.bythebay.io Nov 2025, Oakland, full-stack AI conference Title: Programming machine learning algorithms in hardware, sanely, using Haskell and Rust! We’re all used to programming software. But what about programming reconfigurable hardware? That’s exactly what we can do with Field Programmable Gate Arrays (FPGAs). Programming hardware opens up a whole new dimension to optimizing performance and resource utilization. However, programming FPGAs is challenging and requires esoteric tooling. We can do better! In this talk, we will show how we can use the Clash language to safely program FPGAs and Rust to correctly use them in a machine learning application. Our first step is converting a functional machine learning program into computer hardware. How do we do that? We use Clash! Clash is a Haskell like language that allows programmers to define hardware structurally. It does this by compiling functional programs into logic gates that are then turned into circuits on the FPGA. Clash includes a dependent type system, which allows Clash to guarantee that the circuits are wired up correctly on the FPGA, leading to fewer errors. We will demonstrate how a simple machine learning algorithm can be sped up by the hardware parallelism afforded to FPGAs, and highlight how Clash’s type system provides compile time guarantees that the hardware circuits are implemented correctly. OK, so we’ve got our FPGA hardware wired up correctly using Clash, but how do we make sure we use it correctly? What if we’re using it to run powerful and dangerous magnets in an imaging scanner? Well, we better…