MCPcopy
hub / github.com/tinygrad/tinygrad / to_program

Function to_program

tinygrad/codegen/__init__.py:204–208  ·  view source on GitHub ↗
(ast:UOp, renderer:Renderer)

Source from the content-addressed store, hash-verified

202
203to_program_cache: dict[tuple, UOp] = {}
204def to_program(ast:UOp, renderer:Renderer) -> UOp:
205 config = (NOOPT, EMULATED_DTYPES, NOLOCALS, USE_TC, IMAGE, DISABLE_FAST_IDIV, TRANSCENDENTAL, ALLOW_TF32)
206 key = (ast.key, type(renderer), renderer.target, *[x.value for x in config])
207 if (prg:=to_program_cache.get(key)) is None: to_program_cache[key] = prg = do_to_program(ast, renderer)
208 return prg

Callers 15

exec_validateFunction · 0.90
realize.pyFile · 0.90
dcache_flushFunction · 0.90
_try_compileFunction · 0.90
compile_netFunction · 0.90
eval_uopFunction · 0.90
test_codegen_tracingMethod · 0.90
get_cfgMethod · 0.90
test_float16_aluMethod · 0.90
test_gemmMethod · 0.90

Calls 2

do_to_programFunction · 0.85
getMethod · 0.45

Tested by 15

test_codegen_tracingMethod · 0.72
get_cfgMethod · 0.72
test_float16_aluMethod · 0.72
test_gemmMethod · 0.72
test_gemm_tc_unrollMethod · 0.72
test_gemm_upcastedMethod · 0.72
test_gemm_groupMethod · 0.72
test_reduceMethod · 0.72
test_reduce_groupMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…