AReaL-TIK: Stateful Agentic Optimization of Unified RL Kernels through an Optimization IR
Ran Yan, Youhe Jiang, Jiayi Nie, Wenshuang Li, Yingqi Peng, Taiyi Wang, Tongkai Yang, Binhang Yuan
Abstract
Reinforcement learning (RL) post-training often uses distinct GPU kernels for rollout and policy update. In synchronous PPO and GRPO, numerical disagreement can perturb ratios between current token probabilities and those assigned during rollout. Recomputing rollout log-probabilities with the policy-update backend avoids this discrepancy but adds a forward pass. Bitwise-consistent unified kernels permit reuse when the policy snapshot and probability processing match the objective. Their optimization must preserve agreement across distinct execution regimes. We present KernelBraid, an agentic framework starting from a hand-tuned, bitwise-consistent implementation. Its optimization intermediate representation (IR) organizes source-code search by linking implementations and modifications to numerical requirements, workload measurements, and derivation history. The agent coordinates changes and retains verified intermediates for further exploration; promotion requires passing correctness checks and improving aggregate latency within per-workload limits. Across 12 end-to-end training configurations on H20, KernelBraid achieves 1.10x average throughput relative to AReaL with log-probability recomputation, and the mean training-reward ratio rounds to 1.00x. Isolated-layer profiling yields 1.40x average speedup in summed phase time across 15 model-GPU pairs. Operator-level evaluation covers correctness and performance for 10 operators on A100, H20, and H200, all passing the prescribed bitwise checks. Unified-attention search achieves 2.52x speedup in summed workload latency over the starting implementation using 7M LLM tokens; ablations assess the contributions of retained evidence and branch exploration to search efficiency and attained performance. Our code is open-sourced at https://github.com/areal-project/AReaL-TIK.
Create a lesson
Related papers
Omokage: Understanding How Agents Develop and Optimize HPC Kernels on GPUs
Shared title terminologycs.DCLingqi Zhang, Jens Domke, Chen Zhuang et al.
KernelOPT: Dispatch-Aware Agentic Search for GPU Kernel Optimization
Shared title terminologycs.DCAheli Poddar, Sanskar Prasad, Arindam Samanta et al.
Half a Bit per Parameter: How Much Optimizer State Does Training Need to Survive a Failed GPU?
Shared title terminologycs.DCZiyang Lin, Zixuan Sun
Joule is FLOP: Optimizing Tensor-Core Kernels Beyond Latency Hiding at the GPU Power Wall
Shared title terminologycs.DCTaowen Liu, Zhiwen Mo, Hongxiang Fan et al.
EdgeAgent: Orchestrating On-Device LLM inference for End-User Multi-Agent Systems on CPU-GPU Unified Memory Architectures
Shared title terminologycs.DCYuhai Long, Yuanxin Wei, Kai Wu et al.
Validating Memory-Optimal Transformer Kernels on Real Hardware: From Formal Derivation to Measured Performance Across Two HPC Clusters
Shared title terminologycs.DCLenore M. Mullin, Gaetan Hains