MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / flush_batch

Function flush_batch

tinygrad/engine/jit.py:36–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 current_batch_devs: list[Compiled] = []
35
36 def flush_batch():
37 nonlocal current_batch, current_batch_devs, max_batch_size, new_src
38 if len(current_batch) <= 1 and not getenv("GRAPH_ONE_KERNEL"): new_src.extend(current_batch)
39 else:
40 new_src.append(create_graph_call(current_batch))
41 max_batch_size *= 2
42 if DEBUG >= 2: print(f"JIT GRAPHing batch with {len(current_batch)} kernels")
43 current_batch, current_batch_devs = [], []
44
45 for si in linear.src:
46 if si.src[0].op is Ops.BUFFER_VIEW: continue

Callers 1

graph_split_rewriteFunction · 0.85

Calls 3

getenvFunction · 0.90
create_graph_callFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…