.

Members-Only

Recent Talks & Demos are for members only

Exclusive feed

You must be an AI Tinkerers active member to view these talks and demos.

March 27, 2025 · Toronto

Rust Compiler Autodiff Hacking

Learn how to build a Rust compiler with automatic differentiation, inspect LLVM IR rewrites, replace manual backpropagation, and train a Rust-translated LLM model.

Overview
Links
Tech stack
  • Rust
    Rust is a high-performance systems programming language that guarantees memory and thread safety via its compile-time ownership model.
    Rust is a statically-typed systems language engineered for performance and reliability, directly challenging C/C++ in speed. Its core innovation is the ownership model and 'borrow checker,' which enforces strict memory and thread safety at compile-time, eliminating data races and null pointer dereferences without a conventional garbage collector. Rust achieves near-native speed through 'zero-cost abstractions,' allowing high-level features to compile into highly optimized code. Major industry players, including Microsoft and Cloudflare, leverage Rust for critical infrastructure, and it is now officially supported for development in the Linux kernel.
  • LLVM
    LLVM is a modular compiler and toolchain infrastructure, providing reusable, language-agnostic components for high-performance compilation and optimization.
    LLVM is a collection of modular compiler and toolchain technologies, designed for maximum reusability and performance. Its core is the Intermediate Representation (IR), a portable, high-level assembly that acts as the optimization target between the frontend and backend stages. This three-part architecture allows projects like Clang (for C/C++) and compilers for Swift and Rust to share a single, powerful optimization and code generation engine. This flexibility enables efficient, cross-platform compilation for diverse architectures: from x86 and ARM to GPUs, making LLVM a foundational component in modern operating systems and development toolchains.
  • Enzyme
    Protein biocatalysts: accelerating specific chemical reactions (EC 1 to EC 6) for sustainable, high-efficiency industrial and medical applications.
    Enzyme technology leverages biocatalysts, typically proteins, to accelerate specific chemical reactions with superior efficiency. This field is critical, spanning industries from food processing (e.g., using Renin for cheese) to pharmaceuticals and biofuels. By employing engineered enzymes, often produced via recombinant DNA technology, processes become more sustainable, requiring less energy and producing less toxic waste than traditional chemical synthesis. For instance, the use of proteases and lipases in modern detergents allows for effective cleaning at lower wash temperatures, a direct energy-saving benefit. The objective is clear: design innovative, competitive, and environmentally sound products.
  • rust2c
    C2Rust is the high-efficiency transpiler that automatically migrates C99-compliant codebases to functionally equivalent, though initially unsafe, Rust.
    This is C2Rust: the essential tool for migrating legacy C code to a safer Rust environment. Developed by Galois and Immunant, the core `c2rust transpile` utility converts C99 code into semantically identical Rust, primarily using `unsafe` blocks to maintain functionality. The primary objective is to automate the costly first step of migration, providing a functional Rust codebase that passes original test suites. The broader C2Rust project includes a refactoring component and cross-checking tools: this allows development teams to incrementally lift the auto-translated code into safe, idiomatic Rust, effectively eliminating memory corruption vulnerabilities at scale.
  • LLM
    Large Language Models (LLMs) are deep learning models, built on the Transformer architecture, that process and generate human-quality text and code at scale.
    LLMs are a class of foundation models: massive, pre-trained neural networks (often with billions to trillions of parameters) that leverage the self-attention mechanism of the Transformer architecture (introduced in 2017) to predict the next token in a sequence. Trained on vast datasets (e.g., Common Crawl's 50 billion+ web pages), these models—like GPT-4, Gemini, and Claude—acquire predictive power over syntax and semantics. They function as general-purpose sequence models, enabling critical applications such as complex content generation, language translation, and automated code completion (e.g., GitHub Copilot). Their core value: generalizing across diverse tasks with minimal task-specific fine-tuning.

Related projects