Files
onepilot/tinygrad_repo/docs/developer/runtime.md
github-actions[bot] 7fa972be6a sunnypilot v2026.02.09-4080
version: sunnypilot v2025.003.000 (dev)
date: 2026-02-09T02:04:38
master commit: 254f55ac15a40343d7255f2f098de3442e0c4a6f
2026-02-09 02:04:38 +00:00

1.2 KiB

Runtime Overview

Overview

A typical runtime consists of the following parts:

Compiled

The Compiled class is responsible for initializing and managing a device.

::: tinygrad.device.Compiled options: members: [ "synchronize" ] show_source: false

Allocator

The Allocator class is responsible for managing memory on the device. There is also a version called the LRUAllocator, which caches allocated buffers to optimize performance.

::: tinygrad.device.Allocator options: members: true show_source: false

::: tinygrad.device.LRUAllocator options: members: true show_source: false

Program

The Program class is created for each loaded program. It is responsible for executing the program on the device. As an example, here is a CPUProgram implementation which loads program and runs it.

::: tinygrad.runtime.ops_cpu.CPUProgram options: members: true

Compiler

The Compiler class compiles the output from the Renderer and produces it in a device-specific format.

::: tinygrad.device.Compiler options: members: true