Skip to content
Sergi edited this page Oct 28, 2026 · 5 revisions
u/Sergio • June 20 2026

Welcome to the didactic-octo-memory wiki!

The initial goal of this project was to create a reusable module in which the definition of a custom kernel is decoupled from the execution logic; however, it was decided to broaden the scope of optimization and implement more comprehensive solutions.

ZeroOverhead-Inference: Ultra-Low Latency Kernel-Level Inference Engine, and Triton CUDA Kernel Optimization for LLM Attention and GEMM R&D.

An ultra-low latency, framework-free inference engine designed to execute deep learning models directly at the hardware layer. By bypassing the massive abstraction layers of standard runtimes (like PyTorch or TensorFlow), this project implements custom low-level kernels, explicit thread-to-core pinning, and a custom memory pool to extract maximum hardware utilization for edge and real-time computing. 

The Core Problem

Standard deep learning frameworks are built for generality, handling everything from large-scale training to massive model architectures. However, when deploying small neural networks (e.g., edge image classifiers, compact NLP models) on specialized or constrained hardware, these abstractions introduce devastating overheads. 

CPU-GPU synchronization bottlenecks, generic OS thread scheduling, dynamic memory allocations, and suboptimal vector instruction generation frequently consume more time and memory than the actual mathematical operations of the model. 

The Solution: A Hardware-Oriented Inference Runtime

This project eliminates runtime overhead entirely by treating the inference engine as a dedicated systems programming problem. 

Key Architectural Pillars

  • Custom Low-Level Kernels: Hand-optimized General Matrix Multiplication (GEMM) kernels written directly in low-level languages (CUDA C++ / AVX intrinsics) utilizing register blocking, loop unrolling, and shared memory caching.
  • Deterministic Memory Management: Zero dynamic allocations (malloc/cudaMalloc) during execution. The engine utilizes a pre-allocated static scratchpad memory pool, ensuring deterministic memory footprints and eliminating fragmentation.
  • Hardware-Bound Scheduling: Bypasses general-purpose OS schedulers by implementing direct thread-affinity binding (pinning execution threads to specific hardware compute units) and managing asynchronous hardware queues.
  • Quantized Execution Pipeline: Native INT8 quantization support, transforming weights and activations from FP32 to highly optimized integer representations tailored for vector instructions.

Key Performance Benefits

  • Deterministic Latency: Drastic reduction in tail latency (p99) by removing runtime garbage collection, dynamic memory allocation, and OS thread migration.
  • Minimal Memory Footprint: Up to a 4x reduction in total memory usage, making it ideal for microcontrollers, mobile processors, and embedded accelerators.
  • Maximum Hardware Saturation: Forces the underlying hardware (such as CPU SIMD units or GPU Tensor Cores) to operate at peak theoretical FLOPs for tiny tensor shapes.

read next: The project structure overview and functional description