Skip to content

tinygrad directory layout¤

This explains the flow of a big graph down to programs.

Directories are listed in order of how they are processed.


tinygrad/schedule¤

Group UOps into kernels.

get_kernel_graph ¤

get_kernel_graph(sink: UOp) -> UOp

tinygrad/codegen/opt¤

Transforms the ast into an optimized ast. This is where BEAM search and heuristics live.


tinygrad/codegen¤

Transform the optimized ast into a linearized and rendered program.

get_program ¤

get_program(ast: UOp, renderer: Renderer) -> ProgramSpec

tinygrad/renderer¤

Transform the linearized list of UOps into a program, represented as a string.

Renderer ¤

Renderer(target: Target)

Methods:

render ¤

render(uops: list[UOp]) -> str

tinygrad/engine¤

Abstracted high level interface to the runtimes.

get_program ¤

get_program(ast: UOp, renderer: Renderer) -> ProgramSpec