Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Together AI 28 min read Deep dive hardMaster

Last year we built megakernels. This year we deleted them: The road to Together Compiler

Megakernels for Llama 1B hit 990 TPS on H100 but were too inflexible to productionize, supporting only one model, batch size and precision. Applying CUDA Graphs plus Programmatic Dependent Launch (PDL) to default Torch Inductor kernels recovers 98% of that performance with no hand-written kernels, and agent-driven "multi-kernels" beat the old megakernels by up to 1.7x, exceeding 1100 TPS. The analysis also shows where Inductor falls short: workload-dependent flag effects across 607 config options, misleading isolated benchmarks (L2 flushes, zeroed inputs, CPU launch overhead in timings), and greedy pairwise fusion that ignores SM utilization. These findings shaped Together Compiler, a system that searches the optimization space and measures kernels inside real forward passes on real data.

Related posts

  • Custom Kernels for All from Codex and Claude

    Hugging Face mediumAdept

    Hugging Face packaged CUDA kernel expertise (GPU architecture guides for H100/A100/T4, diffusers and transformers integration patterns, vectorized kernel templates, benchmark scripts) into an agent skill that lets Claude and Codex generate complete kernel-builder projects with PyTorch bindings. Agent-written RMSNorm kernels averaged 1.88x over PyTorch for LTX-Video and 1.94x for Qwen3-8B on H100 in BF16, with Qwen3 speedups growing from 1.58x at 128 tokens to 2.47x at 8192. End to end, LTX-Video gained only 6% (1.43x with torch.compile), consistent with RMSNorm taking about 5% of compute. The post also walks through building all PyTorch/CUDA variants with Nix and publishing to the Kernel Hub for one-line loading via get_kernel.

  • Key research and product announcements at the AI Native Conf

    Together AI hardMaster

    Together AI announced seven research and product releases spanning GPU kernels, reinforcement learning infrastructure and inference optimization. FlashAttention-4 targets NVIDIA Blackwell and is reported 2.7x faster than Triton and 1.3x faster than cuDNN 9.13. A single-kernel Megakernel cut a voice agent's time-to-first-64-tokens from 281ms to 77ms, and together.compile beats torch.compile by 41% on a Flux Kontext benchmark. ThunderAgent schedules whole agentic workflows to avoid KV cache thrashing and leaked tool sandboxes, ATLAS-2 retrains speculative decoders online from live traffic, and cache-aware prefill-decode disaggregation sends warm and cold requests to separate tiers over an RDMA KV cache for 35-40% higher QPS.

  • Together Compiler: Continual Compilation for AI inference

    Together AI hardMaster

    Together Compiler (TKCC) is an agent-driven continual optimization loop that recompiles inference engines as model, hardware and traffic shape drift. It avoids repeated engine restarts by using persistent engines that hot-reload candidate forward passes, cutting time-to-serving from 467s to 9s and raising experiment throughput 252x. A two-tier setup pairs fast few-layer engines for low-variance timing with slower many-layer engines that check results on real data distributions, which matters for MoE and sparse attention. A cost model combining hardware specs, microbenchmarks and measured forward passes picks the parallelism strategy, and the system reports up to 2.6x higher TPS on InferenceX AgentX, 1.7x over open-source megakernels on Llama 1B at batch size 1, and gains on non-LLM workloads.

  • ParallelKernelBench: Frontier LLMs can't write fast multi-GPU kernels (yet)

    Together AI hardMaster

    ParallelKernelBench is a benchmark of 87 multi-GPU problems drawn from Megatron-LM, DeepSpeed, DeepEP, TensorRT-LLM, NeMo-RL and non-LLM workloads. In each problem a model must replace a PyTorch + NCCL reference with a CUDA kernel that moves data directly over NVLink using symmetric memory. Frontier models do poorly: the best (GPT-5.5) solves 28 problems zero-shot and only 31% beat the baseline even with three samples. Strong models fail mainly on rank coordination, collective ordering and the choice of transfer mechanism, and they rarely use TMA or NVLS. An agentic compile-test-benchmark loop lifted Gemini 3 Pro to 35 correct and 26 faster solutions before plateauing at about 20 steps, though models did produce some novel fast kernels, such as a fused vocab-parallel log-prob for NeMo-RL's GRPO.

  • KernelEvolve: How Meta’s Ranking Engineer Agent Optimizes AI Infrastructure

    Meta Engineering hardMaster

    KernelEvolve is Meta's agentic kernel-authoring system that treats kernel optimization as a search problem instead of one-shot LLM code generation. Monte Carlo tree search and evolutionary strategies explore hundreds of candidate kernels across Triton, CuTe DSL, FlyDSL, CUDA, HIP and MTIA C++. Nodes use configurable memory operators that draw on parent, sibling or no history. A retrieval-augmented, self-updating knowledge base supplies hardware documentation and distilled optimization skills, and an evaluation harness (TritonBench, PyTorch Profiler, NCU, Proton, MTIA Insight) feeds diagnoses of memory-bound, compute-bound or occupancy limits back to the LLM. Results include over 60% inference throughput gain for the Andromeda ads model on NVIDIA GPUs and over 25% training throughput gain on MTIA, achieved in hours rather than weeks of expert tuning.

The quest for software engineering knowledge.

Look:
Layout: