Documentation
Global Variables

Global Variables

The columns of this list are are: Variable, Possible Value(s) and Description.

  • A # means that the variable can take any integer value.

These control the behavior of core tinygrad even when used as a library.

VariablePossible Value(s)Description
DEBUG[1-4]enable debugging output, with 4 you get operations, timings, speed, generated code and more
GPU[1]enable the GPU backend
CUDA[1]enable CUDA backend
CPU[1]enable CPU backend
MPS[1]enable MPS device (for Mac M1 and after)
METAL[1]enable Metal backend (for Mac M1 and after)
METAL_XCODE[1]enable Metal using macOS Xcode SDK
TORCH[1]enable PyTorch backend
CLANG[1]enable Clang backend
LLVM[1]enable LLVM backend
LLVMOPT[1]enable slightly more expensive LLVM optimizations
OPT[1-3]optimization level
BEAM[#]number of beams in kernel beam search
GRAPH[1]create a graph of all operations (requires graphviz)
GRAPHPATH[/path/to]where to put the generated graph
IMAGE[1]enable 2d specific optimizations
FLOAT16[1]use float16 for images instead of float32
DISALLOW_ASSIGN[1]disallow assignment of tensors
CL_EXCLUDE[name0,name1]comma-separated list of device names to exclude when using OpenCL GPU backend (like CL_EXCLUDE=gfx1036)
CL_PLATFORM[# >= 0]index of the OpenCL platform (opens in a new tab) to run on. Defaults to 0.
RDNA[1]enable the specialized RDNA 3 (opens in a new tab) assembler for AMD 7000-series GPUs. If not set, defaults to generic OpenCL codegen backend.
PTX[1]enable the specialized PTX (opens in a new tab) assembler for Nvidia GPUs. If not set, defaults to generic CUDA codegen backend.