MCPcopy
hub / github.com/tinygrad/tinygrad / test_fail_1

Method test_fail_1

test/null/test_linearizer_failures.py:9–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7
8class TestLinearizerFailures(unittest.TestCase):
9 def test_fail_1(self):
10 c0 = UOp(Ops.PARAM, dtypes.float.ptr(64), arg=0, src=())
11 c1 = UOp.range(UOp.const(dtypes.weakint, 2), 1, AxisType.LOOP)
12 c2 = UOp.range(UOp.const(dtypes.weakint, 32), 2, AxisType.LOOP)
13 c3 = ((c1*UOp.const(dtypes.weakint, 32))+c2)
14 c4 = UOp(Ops.PARAM, dtypes.float.ptr(163840), arg=1, src=())
15 c5 = UOp.range(UOp.const(dtypes.weakint, 2560), 0, AxisType.REDUCE)
16 c6 = c4.index(((((((c5//UOp.const(dtypes.weakint, 8))%UOp.const(dtypes.weakint, 8))*UOp.const(dtypes.weakint, 8))+(c5%UOp.const(dtypes.weakint, 8)))+(((c2*UOp.const(dtypes.weakint, 40))+(c5//UOp.const(dtypes.weakint, 64)))*UOp.const(dtypes.weakint, 64)))+(c1*UOp.const(dtypes.weakint, 81920))))
17 c7 = UOp(Ops.PARAM, dtypes.float.ptr(64), arg=2, src=())
18 c8 = c7.index(c3)
19 c9 = ((((c6+(c8*UOp.const(dtypes.float, -1.0)))*(c6+(c8*UOp.const(dtypes.float, -1.0)))).reduce(c5, arg=Ops.ADD)*UOp.const(dtypes.float, 0.000390625))+UOp.const(dtypes.float, 1e-05)).sqrt().reciprocal()
20 c10 = c0.index(c3).store(c9).end(c1, c2)
21 ast = c10.sink(arg=KernelInfo())
22 to_program(ast, renderer=Device[Device.DEFAULT].renderer)
23
24if __name__ == '__main__':
25 unittest.main()

Callers

nothing calls this directly

Calls 13

indexMethod · 0.95
UOpClass · 0.90
KernelInfoClass · 0.90
to_programFunction · 0.90
reciprocalMethod · 0.80
sqrtMethod · 0.80
ptrMethod · 0.45
rangeMethod · 0.45
constMethod · 0.45
reduceMethod · 0.45
endMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected