From e784910d47ec1ab22528866d06a95b820b198ee5 Mon Sep 17 00:00:00 2001 From: muh-bot Date: Thu, 6 Aug 2026 02:32:34 +0000 Subject: [PATCH] =?UTF-8?q?[ENGINE]=20Pattern=207:=20CCCL=20C=20API=20JIT?= =?UTF-8?q?=20=E2=86=92=20Triton=20autotune=20mapping?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine_cccl_patterns.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/engine_cccl_patterns.py b/engine_cccl_patterns.py index f1f3c427..1557d184 100644 --- a/engine_cccl_patterns.py +++ b/engine_cccl_patterns.py @@ -406,3 +406,19 @@ if __name__ == "__main__": print(f"\nSingle-tile threshold examples:") for sl in [100, 500, 1024, 5000, 12288, 50000]: print(f" seq_len={sl:>6d}: single_tile={should_use_single_tile(sl)}") + + +# ═══════════════════════════════════════════════════════════════ +# Pattern 7: CCCL C API JIT Build-then-Run → Triton autotune +# Source: c/parallel.v2/src/reduce.cu, scan.cu +# EngineX's "algorithm factor substitution" = this pattern +# ═══════════════════════════════════════════════════════════════ +TRITON_AUTOTUNE_CONFIGS = { + "prefill_attention": [ + {"BLOCK_M": 32, "BLOCK_N": 32, "num_warps": 4, "num_stages": 1}, + {"BLOCK_M": 16, "BLOCK_N": 32, "num_warps": 4, "num_stages": 1}, + ], + "decode_v1": [{"NUM_THREADS": 512, "items": 24, "vec": 2}], + "decode_v2": [{"PARTITION_SIZE": 1024}], + "topk": [{"threads": 512, "items": 4, "bits_per_pass": 11}], +}