Skip to content

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

Together AI 6 min read Opinion easyNovice

Optimizing inference speed and costs: Lessons learned from large-scale deployments

Lower LLM inference latency and cost come mainly from how inference runs rather than from buying more GPUs. The levers covered are FP8/FP4 quantization (claimed 20–40% throughput gains), distilled models like DeepSeek-R1 variants (2–5× lower cost), regional proxies that cut 50–100 ms of TTFT, removing GPU stalls via kernel fusion, MoE execution and scheduling, and speculative decoding or MTP (20–50% faster decode). It also covers Blackwell-class hardware with tensor or expert parallelism and dynamically shifting GPU capacity between endpoints. A starting checklist: measure TTFT, decode TPS and network RTT, then add proxies, continuous batching and decoding optimizations.

Related posts

  • Achieve state-of-the-art inference latencies with speculative decoding

    Modal hardMaster

    Speculative decoding is the dominant lever for low-latency LLM serving because decode steps dominate latency and speculation yields multiplicative speedups roughly linear in acceptance length. Working with Decagon's voice agents, Modal combined regional serving, SGLang host-overhead fixes, and open-source kernels with DFlash draft models that reuse target-model KV projections and draft tokens in parallel. Fine-tuning ("mid-training") the speculator on synthetic data generated by the target model from public prompts in the task's output grammar avoids exposing user data. The custom speculator cut about 100ms from a ~290ms p50 baseline, roughly 40% of server-side decode latency, and beat proprietary providers by over 60ms. Out-of-distribution evaluation was used to guard against overfitting.

  • Benchmarking Text Generation Inference

    Hugging Face mediumAdept

    Text Generation Inference ships a benchmarking tool that profiles LLM serving across batch sizes, plotting throughput against latency separately for prefill and decode so deployments can be tuned for a workload such as RAG or chat. Using a duplicable Hugging Face Space bundling TGI with JupyterLab, the walkthrough shows how to read the charts. Vertical regions mean added batch size buys throughput at no latency cost. Horizontal regions mean the server is compute bound: in the example, decode latency stayed flat near 5.3s up to batch 32, while prefill beyond 32 doubled TTFT with no throughput gain. The recommended loop is to benchmark on hardware matching production, adjust TGI launch settings, and repeat, checking real user token patterns in TGI logs.

  • How GPT-5.6 fuses frontier intelligence with frontier efficiency

    OpenAI easyNovice

    GPT-5.6's cost efficiency comes from optimizations across inference and the agentic harness, many of them landed by GPT-5.6 Sol running in Codex. On the inference side, Sol tuned load-balancing heuristics, rewrote production Triton/Gluon kernels (validated with the FpSan floating-point sanitizer) for a 20% cut in end-to-end serving cost, improved its own speculative-decoding draft model for over 15% better token-generation efficiency, and searched workload-specific batching, sharding and KV-cache configurations. The Rust agent harness reduces repeated work by deferring tool and MCP discovery, capping tool output at 10,000 tokens by default, and keeping model-visible history append-only with deterministic tool ordering so prompt-cache prefixes stay intact.

  • Benchmarking inference at scale: coding agents

    Together AI hardMaster

    On a long-context, high-concurrency coding agent workload (prompts ~45k–200k tokens, ~450-token outputs, EAGLE speculative decoding) running Kimi K2.5 on B200 GPUs, Together Inference Engine delivers 31% more per-user TPS than TensorRT-LLM at 2.5M TPM. It holds p50 TTFT at 0.71s, versus 1.1s for TensorRT-LLM and 5.1s for SGLang, which needed 8 GPUs instead of 4 due to EAGLE memory overhead. The gains are attributed to ThunderMLA, a fused megakernel for Multi-head Latent Attention reported as 20–35% faster than FlashMLA, plus custom kernels found through end-to-end profiling. The post argues that prefill-heavy, concurrent long-context load and TTFT under saturation matter more than single-user benchmarks, and closes with vendor cost comparisons against Claude Opus.

  • Optimization story: Bloom inference

    Hugging Face hardMaster

    Hugging Face's BLOOM (176B parameters, 352GB in bf16) inference server reached 5x lower latency and 50x higher throughput over several weeks, starting from 0.3 req/s and 350ms/token on 16xA100 40GB with pipeline parallelism via Accelerate's device_map="auto". A FLOPs estimate (~17 TFLOP per forward pass, a theoretical floor of about 3ms/token) showed how far off that baseline was. The team weighed tensor parallelism against pipeline parallelism and tried a JAX/Flax port on TPUs, ONNX/TensorRT and DeepSpeed. Lessons include using small test models and fixed greedy-generation prompt suites to catch numerical drift, and staying within PyTorch for flexibility after DeepSpeed proved unstable under webserver load.

The quest for software engineering knowledge.

Look:
Layout: