Explore the research collection
1 entry · Follow this search
- Post
One Search, Two Layers: Compiler Controls Inside PyTorch Helion Using NVIDIA CompileIQ
Helion is PyTorch's Python-embedded DSL for GPU kernels (released 2025): write PyTorch with hl.tile, the autotuner explores thousands of Triton configs (block sizes, loop orders, num_warps, num_stages, indexing, pid_type, reduction_loops), lowering through TorchInductor → Triton → PTX → ptxas → SASS. The post's argument: every kernel autotuner (Helion, Triton, torch.compile) searches the same space — "what work each thread block does" — while a second space sits below it: how that work becomes machine assembly via ptxas (NVIDIA's PTX assembler), i.e. register allocation policy, fine-grained instruction scheduling, code-gen heuristics, exposed as tunable "advanced controls" since CUDA 13.3 and left at defaults by everything shipping today. Helion's new autotune_search_acf hands a list of Advanced Control Files (ACFs — binary, portable, versionable compile-time artifacts) to Helion's own autotuner as just another search dimension; the empty string (compiler defaults) is auto-appended so the default is always a candidate — worst case you get back the kernel you had. The substantive argument for joint search: sequential tuning finds a local optimum because the spaces are coupled through hardware — block size/stage count determine register pressure, and register allocation decides whether that pressure causes spills; a control set that would shine at block_sizes=[64,64] is never evaluated there if the kernel config was frozen first under default controls. ACFs are produced by NVIDIA's CompileIQ, which treats compiler-control selection as hyperparameter optimization (evolutionary search: propose population, compile each, correctness-check vs reference, time survivors, breed winners); pip install compileiq. Pre-tuned "Booster Packs" are published on CompileIQ's GitHub releases — the helion-booster-pack holds 24 ACFs tuned across Helion kernels, validated against ptxas from CUDA 13.4, targeting B200 — so the realistic workflow is download the pack, point autotune_search_acf at it, autotune once, pin the winner. Case study (all vendor/first-party, GB200 sm_100 Blackwell, ptxas 13.3.73 / CUDA 13.3, CompileIQ 1.0.3, Triton 3.8.0, locked clocks, correctness vs PyTorch reference, Welch's t-test p<0.05 + Cohen's d>0.2 on every claim): nvfp4_gemv_fp4in_kernel, a W4A4 NVFP4 decode GEMV (N=8192, K=28672 down_proj) that already ships a checked-in Helion AOT config — i.e. the baseline was already swept, so headroom is real. Runtime objective: 0.0971 → 0.0928 ms = 1.047× (4.7%), confirmed in two independent runs (d≈2.5). Occupancy objective (ncu metric): +0.16pp achieved occupancy → ~1.75–2.0% runtime win. Multi-objective (runtime + L1TEX throughput): 6.9% runtime speedup + 4.5pp L1TEX gain (81.51%→85.96%), one Pareto-dominant point, nothing traded off. Joint ACF across two shapes (down_proj + N=15360,K=5120): one ACF beats baseline on both (1.05× d=67.71, 1.01× d=4.54). Stated expectations: 2–7% on already-highly-optimized kernels (meaningful for decode-step kernels running fleet-wide), double digits on less-optimized ones. Caveats (authors' own): ACFs are hardware- and toolkit-specific (sm_90 ACF invalid on sm_100 — can produce incorrect results, not just slower code; correctness check in the search loop is not optional); search time is nontrivial — run offline on kernels that matter, then pin; gains are workload-specific ("the only number that matters for your kernel is the one you measure on your kernel"). Links: github.com/pytorch/helion, helionlang.com, helion examples/acfs, pretuned_kernels; github.com/NVIDIA/CompileIQ, nvidia.github.io/CompileIQ, NVIDIA's CompileIQ blog post.