Posts

Showing posts with the label Data Orchestration

Inference: Build an ML Runtime with Rust and K3s | ML Engineering & MLOps

Image
  Hi All  Machine learning (ML) runtimes are the backbone of executing trained models in production, but understanding their inner workings can be daunting for beginners. In this post, we’ll build a ML Runtime in Rust from scratch and deploy it on Kubernetes—a minimal yet functional system that loads, executes, and manages simple ML models.   By focusing on core concepts like model serialization, inference, and basic error handling, we’ll demystify how ML runtimes operate under the hood. This is a hands-on guide for developers who want to bridge the gap between high-level ML frameworks and low-level system design. View the architecture of the ML runtime below, source code available here :        Components Explained: 1. Rust Application ( main.rs ) * Entry point of the program * Uses tch-rs (PyTorch bindings) for ML operations * Contains the model defini...

Training TinyLlama 1.1B with PyTorch in Google Colab | ML Engineering

Image
Hi All Today we'll be loading a pre-trained model and train it on Colab. Here's a minimal example using Huggingface for transformers and accelerate for memory efficiency. View source below. Let's break down the above code. Block by block. I'm assuming you're using a notebook for this example. However in the full example in my GitHub I've included the Ops files too (Docker and k8s for GKE or AKS). I don't go into those here, I'll have a series of articles tacking MLOps in depth, this is about fine-tuning a pre-trained small LLM in Colab.  Prep: Setup Environment   !pip install -q transformers accelerate datasets peft bitsandbytes   *     transformers provides pre-trained models and training utilities *      peft enables LoRA (low-rank Adaptation), reducing memory usage *        bitsandbytes allows 8-bit precision to shrink model size *        accelerate helps manage GPU memory and multi-GPU setups ...