From 147fc0e648cfd346338eab7db8b94c3eeeb4f74f Mon Sep 17 00:00:00 2001 From: George Hotz Date: Wed, 2 Apr 2025 10:09:24 +0800 Subject: [PATCH] minor l2fetch tweak --- tinygrad/runtime/ops_dsp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/runtime/ops_dsp.py b/tinygrad/runtime/ops_dsp.py index 6e9ca2577d..f40fd92d37 100644 --- a/tinygrad/runtime/ops_dsp.py +++ b/tinygrad/runtime/ops_dsp.py @@ -236,7 +236,7 @@ def prefetch_l2(ld:UOp, idx:UOp): nlen_uop = (nidx.substitute({ranges[-1]: ranges[-1].src[1], **zero_ranges}) - nidx.substitute({ranges[-1]: ranges[-1].src[0], **zero_ranges})).simplify() nidx = nidx.substitute({ranges[-1]: ranges[-1].src[0]}) - buf_lines_total = (idx.src[0].dtype.size+127)//128 + buf_lines_total = ((idx.src[0].dtype.size*idx.src[0].dtype.itemsize)+127)//128 if buf_lines_total < 8192//128: # if the total buffer size is sub 8k, fetch it all x1 = UOp(Ops.CUSTOM, dtypes.void, src=(idx.src[0], UOp.const(dtypes.int, buf_lines_total)),