MCPcopy
hub / github.com/tinygrad/tinygrad / exec_encdec

Function exec_encdec

tinygrad/engine/realize.py:193–198  ·  view source on GitHub ↗
(ctx:ExecContext, call:UOp, ast:UOp)

Source from the content-addressed store, hash-verified

191 return None
192
193def exec_encdec(ctx:ExecContext, call:UOp, ast:UOp) -> float|None:
194 bufs = [cast(Buffer, b.buffer).ensure_allocated() for b in resolve_params(call, ctx.input_uops)]
195 shape, pos_var = tuple(s.arg for s in ast.src if s.op is Ops.CONST), ast.variables()[0].expr
196 with track_stats(ctx, call, bufs[0].device, bufs, ctx.var_vals):
197 bufs[0].allocator._encode_decode(bufs[0]._buf, bufs[1]._buf, bufs[2]._buf, [x._buf for x in bufs[3:]], shape, ctx.var_vals[pos_var])
198 return None
199
200def exec_graph(ctx:ExecContext, call:UOp, ast:UOp) -> float|None:
201 rt = get_graph_runtime(ast, ctx.input_uops)

Callers

nothing calls this directly

Calls 6

castFunction · 0.85
resolve_paramsFunction · 0.85
track_statsFunction · 0.85
ensure_allocatedMethod · 0.80
variablesMethod · 0.80
_encode_decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…