Beyond Prompting: How Algorithmic Evolution Doubled our Training Speed
Klarna used Google DeepMind's AlphaEvolve to evolve nearly 6,000 candidate versions of the PyTorch training pipeline for a large transformer trained on payment events. Over three weeks it raised throughput from 49 to about 97 samples per second under strict determinism, while also improving model quality. Early generations found mixed precision, async CPU-GPU transfers and on-device metric accumulation. Opening the forward pass and data loader to evolution led to deeper rewrites: direct scaled dot-product attention calls in place of PyTorch Transformer modules, and a pre-allocated contiguous dataset buffer sliced into batches. Key lessons: impose hard constraints such as reproducibility from the start (a non-deterministic TF32/cuDNN path reached 143 samples/s but could never be deployed), set plateau-based early stopping, and use a stronger LLM, which raised valid-program rates from about a third to 86–97%.
Related posts
- Accelerating Transformers Fine-Tuning with NVIDIA NeMo AutoModel
Hugging Face hardMasterNeMo AutoModel subclasses Transformers v5's AutoModelForCausalLM and adds Expert Parallelism as a dedicated mesh orthogonal to data parallelism, DeepEP fused all-to-all dispatch, and TransformerEngine kernels. Users swap one import and get 3.4-3.7x higher MoE fine-tuning throughput and 29-32% lower peak memory on Qwen3-30B-A3B and Nemotron 3 Nano on 8 H100s. NeMo AutoModel's benchmarks used a balanced routing gate while v4/v5 ran their native routers. The same path enables full fine-tuning of the 550B Nemotron 3 Ultra across 128 GPUs, where v5 runs out of memory. Explanations cover why v4 deadlocks under FSDP (data-dependent per-expert loops cause mismatched collectives), v5's expert backends (eager, batched_mm, grouped_mm), and reversible dynamic weight loading that keeps checkpoints in standard HF format.
- Productizing Large Language Models
Replit mediumAdeptReplit runs transformer models from ~100M parameters (search, spam) through 1-10B (GhostWriter code autocomplete) to 100B+ in production, and shares lessons on making them usable. Nonsense and repetition loops are handled with temperature and frequency penalty tuning, cycle detection, multi-temperature sampling, reranking with a second model, and fine-tuning on user feedback. Quality is tracked with HumanEval, loop and nonsense rates, and A/B tests. Inference cost is cut with FasterTransformer, distillation and quantization, and GPUs are run at 70-80% utilization on Kubernetes so request queues stay bounded while autoscaling has headroom.
- Accelerate 1.0.0
Hugging Face mediumAdeptHugging Face has published the first release candidates for Accelerate 1.0.0. The library has grown from a thin multi-GPU/TPU training-loop wrapper into the base layer for transformers, diffusers, peft and trl, covering six accelerator types, a launch CLI and big-model inference via device_map="auto". Before 1.0 the team added FP8 support through MS-AMP and TransformerEngine, multi-model DeepSpeed orchestration, torch.compile for big model inference, torch.distributed.pipelining and StatefulDataLoader. Migration notes list the breaking deprecations, such as moving dataloader flags into DataLoaderConfiguration, using AutocastKwargs and renaming is_tpu_available to is_torch_xla_available.
- GEM Training: How Meta Doubled the Efficiency of Its LLM-Scale Ads Foundation Model
Meta Engineering hardMasterMeta doubled end-to-end training efficiency of GEM, its LLM-scale ads recommendation foundation model, to 20–25% MFU while scaling training FLOPs 4x in a year, by co-designing kernels, precision, parallelism, networking and memory. Compute efficiency came from custom recommendation kernels: Jagged Flash Attention (no padding, subtraction-based masking, split-dQ backward, TLX warp specialization), GDPA unifying non-softmax attention variants (up to 3.5x over FA4 on short K/V), and 64-token BlockAttention with fused RoPE, plus MXFP8 attention and MLP that avoid CTR/CVR quality regressions. Scaling efficiency came from topology-aware 5D parallelism (2D FSDP + expert parallelism for dense, fully sharded 2D model parallelism for sparse embeddings) with SM-free collectives. Framing E2E MFU as local MFU × scaling ratio turned a sprawling co-design effort into separable optimization levers.
- Optimum+ONNX Runtime - Easier, Faster training for your Hugging Face models
Hugging Face mediumAdeptHugging Face Optimum's ORTTrainer swaps ONNX Runtime in as the training backend for Transformers models. It reports throughput gains of 39–130% over a PyTorch baseline on an 8×A100 node when combined with DeepSpeed ZeRO Stage 1, and up to 40% with ONNX Runtime alone. The speedups come from memory planning, kernel optimizations, multi-tensor-apply fused Adam, an FP16 optimizer that avoids device-to-host copies, mixed precision and graph fusions. Adopting it mostly means replacing Trainer and TrainingArguments with ORTTrainer and ORTTrainingArguments and optionally selecting the adamw_ort_fused optimizer.