From 812f485cd7158ee5cdc91f862f9675ac97707e17 Mon Sep 17 00:00:00 2001 From: Sieds Lykles <93992551+S-Lykles@users.noreply.github.com> Date: Thu, 18 Sep 2025 01:58:34 +0200 Subject: [PATCH] Enable threefry_doesnt_use_long test on rangeify (#12229) * dont bufferize rangeify * enable doesnt_use_long test --- .github/workflows/test.yml | 2 +- tinygrad/schedule/rangeify.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ead1b9e72..805abb79f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -525,7 +525,7 @@ jobs: # test_instancenorm_3d is very slow run: | CPU=1 CPU_LLVM=0 RANGEIFY=1 python3 -m pytest -n auto --durations 20 \ - -k "not test_threefry_doesnt_use_long and not test_embedding and not test_load_state_dict_sharded_model_dict_same_axis and not test_instancenorm_3d" \ + -k "not test_embedding and not test_load_state_dict_sharded_model_dict_same_axis and not test_instancenorm_3d" \ test/test_tiny.py test/test_rangeify.py test/test_ops.py test/test_tensor_variable.py \ test/test_outerworld_range.py test/test_sample.py test/test_randomness.py test/test_nn.py test/test_arange.py - name: Test const folding diff --git a/tinygrad/schedule/rangeify.py b/tinygrad/schedule/rangeify.py index 8c24a8ba79..32063434a4 100644 --- a/tinygrad/schedule/rangeify.py +++ b/tinygrad/schedule/rangeify.py @@ -376,7 +376,8 @@ def remove_bufferize(src:UOp, buf:UOp, idx:UOp): # here is where we compute the cost # for now just no REDUCE, COPY, or ASSIGN ran = src.toposort(gate=lambda x: x.op not in {Ops.INDEX}) - if any(x.op in {Ops.REDUCE, Ops.COPY, Ops.ASSIGN} for x in ran): return None + # we don't want to bufferize threefry, also causes problems because not all platforms support long + if any(x.op in {Ops.REDUCE, Ops.COPY, Ops.ASSIGN} for x in ran) and src.op is not Ops.THREEFRY: return None # simple, matching old behavior #if src.op is not Ops.INDEX: return None