From 7edf80a48abc3956c47be4ab9525f711d17a889f Mon Sep 17 00:00:00 2001 From: George Hotz <72895+geohot@users.noreply.github.com> Date: Mon, 10 Aug 2026 15:58:49 -0700 Subject: [PATCH] small changes from new rangeify + remove flaky tc tests (#17486) * small changes from new rangeify * remove test/opt/test_tensor_cores.py --- .github/workflows/test.yml | 2 +- test/helpers.py | 4 ++-- tinygrad/uop/symbolic.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7bd3063e41..7fe9471032 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -591,7 +591,7 @@ jobs: if: ${{ matrix.backend == 'amd' && matrix.arch == 'gfx950' }} run: PYTHONPATH=. DEV=NULL:HIP:gfx950 MXFP4=1 LLAMA_LAYERS=2 BENCHMARK=3 NULL_ALLOW_COPYOUT=1 NO_HIPCC=1 ROCM_PATH=/opt/rocm JITBEAM=0 examples/mlperf/training_submission_v6.0/tinycorp/benchmarks/llama31_8b/implementations/tinybox_8xMI350X/profile.sh - name: Run pytest (amd) - run: python -m pytest -n=auto test/backend/test_ops.py test/backend/test_dtype.py test/backend/test_dtype_alu.py test/backend/test_linearizer.py test/backend/test_randomness.py test/backend/test_jit.py test/backend/test_graph.py test/backend/test_multitensor.py test/device/test_hcq.py test/external/external_test_am.py test/backend/test_asm_gemm.py::TestAsmGEMM test/opt/test_tensor_cores.py --durations=20 + run: python -m pytest -n=auto test/backend/test_ops.py test/backend/test_dtype.py test/backend/test_dtype_alu.py test/backend/test_linearizer.py test/backend/test_randomness.py test/backend/test_jit.py test/backend/test_graph.py test/backend/test_multitensor.py test/device/test_hcq.py test/external/external_test_am.py test/backend/test_asm_gemm.py::TestAsmGEMM --durations=20 - name: Run disk copy tests run: python -m pytest test/unit/test_disk_tensor.py -k test_copy_from_disk - name: Run TRANSCENDENTAL math diff --git a/test/helpers.py b/test/helpers.py index ea900d505c..21febed6bc 100644 --- a/test/helpers.py +++ b/test/helpers.py @@ -48,6 +48,8 @@ def check_schedule(t:Tensor|list[Tensor]|UOp, allowed:int, to_prerealize:list[Te else: assert isinstance(t, UOp), f"can't schedule {t}" linear, var_vals = Tensor(t).linear_with_vars() + # test compiling the linear + compile_linear(linear) kernel_cnt = sum((len(call.device) if isinstance(call.device, tuple) else 1) for call in linear.src if call.src[0].op is Ops.SINK or not filter_sink) if kernel_cnt != allowed: @@ -57,8 +59,6 @@ def check_schedule(t:Tensor|list[Tensor]|UOp, allowed:int, to_prerealize:list[Te print("kernel", i+1) print(call.src[0]) raise KernelCountException(allowed, kernel_cnt) - # test compiling the linear - compile_linear(linear) return linear, var_vals def assert_kernel_count(expected:int): diff --git a/tinygrad/uop/symbolic.py b/tinygrad/uop/symbolic.py index 1eda875236..f3d78ebfb5 100644 --- a/tinygrad/uop/symbolic.py +++ b/tinygrad/uop/symbolic.py @@ -293,8 +293,8 @@ symbolic = symbolic_simple+commutative+PatternMatcher([ (UPat(Ops.AFTER, name="x"), lambda x: x.replace(src=(x.src[0],)+ tuple(dedup(flatten([(y,) if y.op in {Ops.RANGE, Ops.STORE, Ops.CALL, Ops.FUNCTION, Ops.BARRIER, Ops.END, Ops.LINEAR, Ops.STAGE} else y.src for y in x.src[1:]]))))), - # after with 1 src is just src[0] - (UPat(Ops.AFTER, src=(UPat.var("s"),)), lambda s: s), + # after/end with 1 src is just src[0] + (UPat((Ops.AFTER, Ops.END), src=(UPat.var("s"),)), lambda s: s), ])+div_and_mod_symbolic # ******** we take a small aside to "simplify_valid" to rewrite valids ********