From 8e868dced88f87f8f705fc8f592c78c227c612a9 Mon Sep 17 00:00:00 2001 From: chenyu Date: Sat, 8 Nov 2025 19:38:44 -0800 Subject: [PATCH] only GROUPTOP one reduce kernel (#13176) * only GROUPTOP one reduce kernel * ALLOWED_GATED_READ_IMAGE=148 --- .github/workflows/test.yml | 2 +- tinygrad/codegen/opt/heuristic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 748dd7880a..4670e154f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -392,7 +392,7 @@ jobs: llvm: 'true' - name: Test openpilot model kernel count and gate usage run: | - ALLOWED_KERNEL_COUNT=123 ALLOWED_READ_IMAGE=1452 ALLOWED_GATED_READ_IMAGE=122 FLOAT16=1 CL=1 IMAGE=2 python examples/openpilot/compile3.py https://gitlab.com/commaai/openpilot-lfs.git/gitlab-lfs/objects/cf6376aa9a090f0da26c280ef69eabf9bbdd51d1faac9ed392919c3db69be916 + ALLOWED_KERNEL_COUNT=123 ALLOWED_READ_IMAGE=1452 ALLOWED_GATED_READ_IMAGE=148 FLOAT16=1 CL=1 IMAGE=2 python examples/openpilot/compile3.py https://gitlab.com/commaai/openpilot-lfs.git/gitlab-lfs/objects/cf6376aa9a090f0da26c280ef69eabf9bbdd51d1faac9ed392919c3db69be916 - name: Test openpilot CL compile fp16 run: FLOAT16=1 DEBUGCL=1 CL=1 IMAGE=2 python examples/openpilot/compile3.py https://gitlab.com/commaai/openpilot-lfs.git/gitlab-lfs/objects/cf6376aa9a090f0da26c280ef69eabf9bbdd51d1faac9ed392919c3db69be916 - name: Test openpilot CL compile fp32 (test correctness) diff --git a/tinygrad/codegen/opt/heuristic.py b/tinygrad/codegen/opt/heuristic.py index bd71d6c265..6419d5d9cd 100644 --- a/tinygrad/codegen/opt/heuristic.py +++ b/tinygrad/codegen/opt/heuristic.py @@ -81,7 +81,7 @@ def hand_coded_optimizations(k:Scheduler) -> Scheduler: return k # are we grouping? (requires local shape support) - if resolve(prod(k.output_shape[i] for i in k.upcastable_dims) <= 2048, False): + if resolve(prod(k.output_shape[i] for i in k.upcastable_dims) <= 2048, False) and len(k.reduceops) == 1: for sz in [16]: try: k.apply_opt(Opt(OptOps.GROUPTOP, 0, sz))