Posts

Showing posts with the label Prometheus

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...

ML Observability with eBpf and OTel Pt. 1: Basics | ML Engineering and MLOps

Image
  Hi All  In this first part of a series on eBPF and Open Telemetry . We detail a couple of useful eBPF scripts tailored for an MLE with no background of the project(s). They focus on observability, performance monitoring and data collection - key areas where eBPF shines. I tried to make these as practical as possible, let's get to it. 1. Tracing Python Function Calls in ML Pipelines Monitor which Python functions are being called in an ML training script (eg. PyTorch/Tensorflow) and their execution time. This helps identity bottlenecks in data loading, preprocessing or model training. Tools: *    bpftrace (for high level scripting) *    libbpf (for custom C-based eBPF programs) *    Run the below script while your ML script is executing. sudo bpftrace -e 'uprobe:python3:PyEval_CallObject { printf("Function called: %s\n", str(arg1)); }' *    Trace all torch.Tensor method calls in a PyTorch script *    The output will show ...