---
title: "Serving MiniMax-M3 for efficient inference: Unlocking 1M-Token Context and Multimodality Without Regrets"
description: "Serving MiniMax M3, a 1M-context multimodal model built on block-sparse MiniMax Sparse Attention (MSA), took several engine and kernel changes that together raised throughput 81–125% across concurrency levels on agentic traffic."
url: "https://swe.quest/articles/serving-minimax-m3-for-efficient-inference-unlocking-1m-token-context-and-b95aa870c48b5834"
canonical: "https://www.together.ai/blog/serving-minimax-m3-for-efficient-inference-unlocking-1m-token-context-and-multimodality-without-regrets"
source: "Together AI"
published: "2026-06-02"
difficulty: "hard"
kind: "Case study"
reading_minutes: 7
tags: ["inference","llms","performance","hardware"]
---

# Serving MiniMax-M3 for efficient inference: Unlocking 1M-Token Context and Multimodality Without Regrets

A post on [Together AI](https://swe.quest/sources/together.md), published 2026-06-02, 7 min read, Case study. Original: [https://www.together.ai/blog/serving-minimax-m3-for-efficient-inference-unlocking-1m-token-context-and-multimodality-without-regrets](https://www.together.ai/blog/serving-minimax-m3-for-efficient-inference-unlocking-1m-token-context-and-multimodality-without-regrets)

## Summary

Serving MiniMax M3, a 1M-context multimodal model built on block-sparse MiniMax Sparse Attention (MSA), took several engine and kernel changes that together raised throughput 81–125% across concurrency levels on agentic traffic. Prefill uses a KV-block-major kernel that loads each KV block once for all queries attending to it, then merges partial outputs with a log-sum-exp reduction. Decode reuses existing GQA paged-attention kernels by building per-KV-group page tables and using strided views of the KV cache, which added 5% decode throughput. The index-scoring kernel uses an AB-swapped HMMA layout over 128-token key blocks. A Rust gateway (SMG) does image and video preprocessing on the CPU before requests reach the GPU.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)

## Prerequisites

- transformer attention
- paged attention / KV cache ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- GPU kernel programming ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))
- grouped-query attention

## Keywords

MiniMax M3, MiniMax Sparse Attention, Together AI, paged attention, NVIDIA B200, HMMA, SMG, FFmpeg

## Related posts

- [Optimizing inference speed and costs: Lessons learned from large-scale deployments](https://swe.quest/articles/optimizing-inference-speed-and-costs-lessons-learned-from-large-scale-1e80b28572985147.md): Together AI · 2026-01-22 · Easy · 6 min read · Inference & serving, LLMs, Cost optimization, Performance engineering
  Lower LLM inference latency and cost come mainly from how inference runs rather than from buying more GPUs.
- [Making FlashAttention-4 faster for inference](https://swe.quest/articles/making-flashattention-4-faster-for-inference-dc917e70c20e0f22.md): Modal · 2026-06-11 · Hard · 14 min read · Inference & serving, Hardware, Performance engineering, LLMs
  Modal engineers extended the FlashAttention-4 kernel for decode-heavy LLM inference on Blackwell GPUs through two kinds of change: new parallelism strategies, such as split-KV parallelism across the key/value dimension, and support for irregular memory access via cp.async in place of TMA bulk loads.
- [Cache-aware prefill–decode disaggregation (CPD) for up to 40% faster long-context LLM serving](https://swe.quest/articles/cache-aware-prefill-decode-disaggregation-cpd-for-up-to-40-faster-long-context-7f727a0ea889f194.md): Together AI · 2026-03-04 · Hard · 9 min read · Inference & serving, Caching, LLMs, Performance engineering, Scheduling
  Cache-aware prefill–decode disaggregation (CPD) extends standard PD serving with a dedicated pre-prefill tier for low-reuse (cold) long prompts, a router that estimates prefix-cache reuse per request, and a three-level KV cache hierarchy (GPU memory, host DRAM, RDMA-connected distributed cache).
- [180B Parameters, 32GB of RAM: Pushing MoE Inference to the Limit with Transformers](https://swe.quest/articles/180b-parameters-32gb-of-ram-pushing-moe-inference-to-the-limit-with-transformers-63cd3cf21432f7c3.md): Hugging Face · 2026-11-18 · Hard · 11 min read · Inference & serving, LLMs, Performance engineering, Caching, Hardware
  Streaming MoE experts from SSD through a bounded device-side slot pool lets Transformers run Qwen3.8-Flash-Next (121 GB of experts) on a 32 GB MacBook M5 at ~13.9 tok/s, within 6% of the specialized Strata engine on decode and slightly faster on prefill.
- [How to serve trillions of tokens for trillion-parameter coding agents](https://swe.quest/articles/how-to-serve-trillions-of-tokens-for-trillion-parameter-coding-agents-0508c7c515fa8a14.md): Modal · 2026-09-23 · Hard · 32 min read · Inference & serving, LLMs, Caching, Performance engineering, Hardware
  Modal describes how it serves Moonshot AI's trillion-parameter Kimi K2.6 model for coding-agent traffic at trillions of tokens.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
