Skip to content

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

Meta Engineering 17 min read Deep dive hardMaster

How We Built TLX: A Hardware-Native GPU Compiler for Production ML at Scale

Triton Low-Level Extensions (TLX) add explicit warp-group, synchronization, memory and cluster-level orchestration to Triton, so engineers can use Hopper and Blackwell features such as TMA, TMEM, mbarriers and paired-CTA execution without dropping to CUDA. Meta frames the design as a "Multiple Instructions, Multiple Warps" (MIMW) model that sits between CUDA's thread-level SIMT and Triton's block-level SIMB. Triton tensor ops still describe the computation, while TLX constructs describe producer/consumer/epilogue warp-group pipelines. Layouts are inferred by default, which makes kernel fusion much easier, and TLX already runs production RecSys training, RecSys inference and LLM pretraining workloads on NVIDIA and AMD GPUs.

Assumes: GPU programming with CUDATriton kernel languageTensor cores and shared memorySoftware pipelining

Related posts

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

    Together AI hardMaster

    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.

  • Hugging Face on AMD Instinct MI300 GPU

    Hugging Face easyNovice

    Hugging Face's transformers and text-generation-inference (TGI) now run on AMD Instinct MI300X GPUs with no code changes, backed by a Kubernetes-scheduled CI pipeline that runs tens of thousands of unit tests on MI250 and MI300 hardware. TGI optimizations for MI300 include Flash Attention v2, Paged Attention, GPTQ/AWQ kernels, fused kernels, and PyTorch's ROCm TunableOp. TunableOp tunes GEMMs during server warmup and gives an 8-10% decode latency gain on small inputs. On Llama 3 70B, MI300X on Azure delivers 2-3x faster time to first token and 2x faster decoding than MI250, and roughly 2x faster LoRA fine-tuning. Its 192 GB HBM3 also fits the full ~140 GB fp16 model on a single GPU.

  • Accelerating SD Turbo and SDXL Turbo Inference with ONNX Runtime and Olive

    Hugging Face mediumAdept

    ONNX Runtime's CUDA and TensorRT execution providers run SD Turbo and SDXL Turbo faster than PyTorch on NVIDIA A100 and RTX 4090 GPUs for every batch-size and step combination tested. Throughput gains reach 229% for SDXL Turbo and 120% for SD Turbo. The speedups come from CUDA graphs for static shapes, Flash Attention V2, trimming unused text-encoder outputs and SkipGroupNorm fusion. TensorRT does slightly better with static shapes but needs a separate engine per batch and image size, while the CUDA provider is often the better pick for dynamic shapes on A100. Olive-optimized models, a usage example, and C# and Java community ports are provided.

  • How Meta trains large language models at scale

    Meta Engineering easyNovice

    Training LLMs at Meta shifted workloads from many small recommendation jobs to a few enormous GPU jobs, forcing changes across hardware, data center layout, reliability, networking and storage. Meta adapted its Grand Teton H100 platform (700W TDP, HBM3, still air-cooled), repacked data halls for GPU density, and tracks common failure modes such as GPUs dropping off PCIe, DRAM/SRAM uncorrectable errors and network cable faults. Instead of choosing between fabrics, it built two 24K-GPU clusters, one RoCE and one InfiniBand, and tuned both to equivalent performance for Llama 3 training. The tuning relied on topology-aware placement of parallelism traffic, custom collectives such as recursive doubling/halving in place of rings, and load balancing to handle fat flows.

  • Introduction to ggml

    Hugging Face mediumAdept

    ggml is a minimal C/C++ tensor library focused on Transformer inference that underpins llama.cpp, whisper.cpp, ollama and LM Studio. It offers a sub-1MB binary, easy compilation with only GCC or Clang, quantized tensors and broad hardware support. The tradeoffs are uneven operation coverage across backends, a steep low-level learning curve and frequent breaking changes. A walkthrough explains its core abstractions (context, computation graph, backend, buffer types, graph allocator, scheduler) and builds a matrix-multiplication example twice: once with tensor data held in a ggml_context, and once with a CPU/CUDA backend, device buffers and graph allocation.

The quest for software engineering knowledge.

Look:
Layout: