Skip to content

Blog

DeepSeek DeepInfer, FlashMLA, and the agent that beat them

By Saif QureshiUpdated 8 min read
  • Inference
  • Costs
  • Open source

Everyone argues about which model topped the leaderboard this week, while the serving stack quietly decides whether your unit economics actually work. You can run the exact same weights and end up with a manageable bill or a terrifying one, depending on the software sitting underneath. Most labs keep that layer locked up.

Then October got interesting. On October 20 DeepSeek put its production serving engine on GitHub under Apache 2.0. Ten days later an autonomous agent beat DeepSeek's flagship attention kernel by 9.8 percent on a public livestream. I spent a week reading what each lab actually documented, and this is my honest take on what matters and what is noise.

Key takeaways

  • DeepInfer is DeepSeek's production engine for V4.1 Flash, opened Oct 20: great kernels and scheduling for offline batch work, with the hardest online serving pieces left out.
  • Your bill has three parts: moving weights, generating tokens one by one, and keeping the machines busy. October attacked all three at once.
  • FlashMLA cuts the memory each attention layer has to move. That is the whole trick, and every other lab is squeezing the same thing.
  • ForgeKernel beat FlashMLA Prefill 472 vs 518 microseconds on a B200 with zero human-written code. Kernel tuning is becoming a loop you run, not a paper you wait for.
  • Do the boring stuff first: batching, caching, quantization, smaller models. Measure cost per finished task, then let kernels fight over the rest.

Why two teams pay different prices for the same model

I have watched this happen enough times to stop being surprised by it. Same model, same provider price list, totally different bills at the end of the month. One team batches well and caches prefixes. The other fires one request at a time and retries in a loop. The model is identical. The serving is not.

That is why I read inference releases differently than model releases. A model release tells me what got smarter. An inference release tells me what got cheaper to run, and cheaper to run is what decides whether a feature survives contact with real traffic. October was the busiest month for that kind of release in a while, so let me walk through it the way I actually pieced it together.

Quick honesty note before we start. Almost every number below comes from the labs themselves. DeepSeek's benchmarks are DeepSeek's own, Hugging Face's 40 percent is Hugging Face's claim, and nobody outside those teams has independently confirmed them yet. I will say whose number each one is as we go.

What DeepInfer actually is, minus the hype

DeepInfer is the internal engine DeepSeek uses to serve V4.1 Flash in production, and it pulled in roughly 17,500 GitHub stars and 1,800 forks within a day of release. You can read the source yourself in the DeepInfer repository. If you read past the hype, though, the README is pretty clear about what you actually get. Right now it is built for offline batch jobs on a single model, supports Nvidia SM100 and Huawei Ascend 950, and ships with DeepSeek's own benchmarks while leaving out the hardest online serving pieces.

The kernel list reads like DeepSeek's greatest hits album: FlashMLA for attention, DeepGEMM for matrix math, DeepEP for shuttling expert traffic between chips, plus TileKernels, DeepSelect, and custom TileLang kernels. V4.1 Flash is a mixture of experts model, which means each token only visits a few expert networks sitting on different chips. Getting tokens to the right expert and back fast is most of the battle, and most of DeepInfer is about winning exactly that.

The part I keep coming back to is FlashMLA, because the idea is simple once someone explains it well. Attention normally drags a huge key value cache through memory for every single token. FlashMLA compresses that representation first and computes directly on the compressed form, so every layer moves far less data. Less data moved per token means cheaper tokens. That is it. That is the whole trick, and it is a good one. My read, and the sharpest secondary writeup I found agrees with me here (the djcroman breakdown), is to treat DeepInfer as a reference design for batch work rather than a server you drop into production tomorrow. The online pieces you would need, like serious KV cache management and prefill decode disaggregation, are the parts they kept.

October hit all three parts of the bill at once

I like the way the GraphWiz roundup splits this, so I am borrowing its framing. Your inference bill has three parts, and each October release went after a different one. They stack instead of competing, which is rare and kind of great.

  • Moving the weights: vLLM Humming, a set of JIT compiled quantized kernels claiming 2.5 to 4.5x over DeepGEMM and 14 to 43 percent end to end throughput. One kernel library across quantization formats, which matters more than it sounds if you have ever juggled three of them.
  • Generating tokens one by one: DeepSeek DSpark, speculative decoding with confidence scheduling, claiming 60 to 85 percent faster per user generation. A small draft model guesses ahead and the big model checks the guesses. When the guesses are good you skip a lot of slow steps.
  • Keeping the machines busy: DeepInfer on the batch side at a claimed 155T tokens a day, and llm-d v1.0 on the orchestration side with disaggregated prefill and decode plus multi tenant scheduling. Boring plumbing, huge effect on utilization.

Then an agent beat DeepSeek at its own game, live

This is my favorite part of the whole month, honestly. On October 30, ModelBest ran a 22.5 hour public livestream where their ForgeKernel agent went after DeepSeek's FlashMLA Prefill kernel on a single Nvidia B200. Its first attempt was slow at 1,834 microseconds, then it dropped below 593 within four hours, passed FlashMLA around hour seven, and finished at 472 microseconds against FlashMLA's 518. That is a 9.8 percent win across 42 iterations and 32 versions, using 22 GPU hours and no human-written code. You can read the full trace in the Guozhen report.

Two things about the setup matter more than the percentage. First, the agent never saw DeepSeek's code. It got the math definition and the hardware constraints and had to figure out the rest, which rules out the most boring explanation. Second, the same system had already topped Huawei's CANNBench boards on Ascend chips days earlier, including the widely deployed 910C. One system winning on both CUDA and Ascend toolchains is genuinely surprising, because those worlds usually need totally different hand tuning.

The team documented the method instead of just posting a screenshot, which I respect a lot. They put up a paper called JustGoal with Tsinghua folks saying the setup gives the model only an optimization goal, no kernel knowledge and no fixed workflow, and claims wins over human maintained libraries on eight of ten B200 kernels. Then they announced ForgeKernel would go open source, so anyone can rerun that loop on their own traffic. My personal take: kernel tuning just turned into something you run next to your evals instead of something you wait for. That changes who gets to be fast.

Everyone else is squeezing the same lemon

Once you see the pattern, you see it everywhere. Hugging Face pushed a kernel overhaul around the same time, claiming up to 40 percent lower inference costs by fusing operations, mixing FP16, BF16, and INT8 precision, and compiling caches. Combining multiple kernel launches into a single pass reportedly cuts transformer layer overhead by up to 60 percent. Different layer of the stack from FlashMLA, same basic takeaway: moving bytes around in memory is what really drives your GPU bill.

Google's TurboQuant squeezes the KV cache itself down to 3 bits with no measured accuracy loss, which is roughly a 6x memory cut on the cache. And there are reports of application specific vocabularies cutting inference cost by up to 77 percent in real workloads, which makes sense when you think about it, since a smaller vocabulary means smaller matrices everywhere. Different teams, different layers, one shared enemy: bytes per token.

What I would actually do on Monday morning

If I were deciding what to do with all of this tomorrow, I would keep it simple and honestly kind of boring. The order has not changed: fill the machines with batching first, store weights and KV cache in as few bits as your evals allow, reuse shared prompt prefixes, and pick the smallest model that still passes. One guide I trust puts batching alone at more than 10x on cost per million tokens, and nothing in October contradicts that. Kernels come after the big four are measured, not before.

Then I would track cost per successful task instead of cost per token, because a kernel that makes failures 10 percent faster is worse than a dumber setup that fails half as often. Same task, same success checks, side by side. That is how I would judge DSpark on latency sensitive routes, Humming style quantized kernels everywhere, or any newly quantized build. Turn on prefix caching and quantized kernels now, test speculative decoding where latency hurts, and treat DeepInfer as batch reference.

And I would put a kernel evolution loop next to my evals this quarter. Not as a research project, as a cron job. The ForgeKernel story tells me the team that reruns an open loop on its own traffic will beat the team waiting for the next hand tuned release. If you want the deeper pieces, I wrote them up separately: distilling a frontier model for the repetitive classifiers, the LoRA and QLoRA guide for narrow formats, and agent loops that finish so your generation loops stop instead of billing you forever.

Use cases: which cost levers fit your setup

Most teams will never touch a kernel, and they do not need to. The order from Monday morning still applies, but which levers you can pull depends on how you run models.

  • You call a hosted API. You cannot batch on the provider's machines, but you can choose the smallest model that passes your evals, reuse shared prompt prefixes where the provider caches them, and send work that can wait through a batch option if your provider offers one. Track cost per success to see what each change did.
  • You self-host open models. All of the levers are yours: batching, quantized weights and KV cache as far as your evals allow, and prefix caching. This is where engines such as DeepInfer and kernels such as FlashMLA matter, and where you rerun your own comparisons when a new release lands.
  • Your product is latency-sensitive. Chat, voice and autocomplete care about the first token more than the price per million. Speculative decoding and prefix caching are the levers to test first, judged by latency and success together.
  • You run large overnight or batch jobs. Tagging, extraction and classification at volume are where batching pays most, and they are often the jobs a distilled small model can take over.

Try it this week: rank the levers for your workload

Write down your three biggest AI workloads, how you run each one, and what one run costs today. Then let the prompt below put the levers in order. Change one thing at a time and measure it against the same success checks.

Prompt to paste into Claude or ChatGPT
prompt
Goal: rank the inference cost levers for my three biggest AI workloads.
Inputs: for each workload, what it does, runs per month, hosted API or self-hosted, the model, latency needs, and cost per run today.
Constraints: consider only these levers: a smaller model that still passes evals, batching or a batch option, quantization, prefix or prompt caching, speculative decoding, and distilling a small model. Mark which levers I cannot use because of how I run the model. Do not invent prices.
Definition of done: per workload, the two levers to try first, why, how I measure the result (cost per successful task and latency), and what would make me stop.

Frequently asked questions

What is DeepInfer in one paragraph?

DeepSeek's in house serving engine for V4.1 Flash, opened on Oct 20 2026 under Apache 2.0. It bundles the FlashMLA, DeepGEMM, and DeepEP kernels with scheduling across chips, aimed at offline batch inference. The trickiest online serving pieces are not included, so read it as a reference design for batch work.

What does FlashMLA actually do?

It compresses the key value representation each attention layer works with and computes on the compressed form. Less memory moved per token, cheaper tokens. It is an attention kernel, not a model, and it lives inside DeepInfer.

Did an AI really beat FlashMLA?

On Oct 30 2026 the ForgeKernel agent beat the FlashMLA Prefill kernel 472 vs 518 microseconds on a B200, about 9.8 percent, over a public 22.5 hour run with no human written code and no access to DeepSeek's implementation. It had also topped Huawei CANNBench boards just before. The team says ForgeKernel will be open sourced.

Where should a small team start on inference cost?

Batching, quantization, prefix caching, and the smallest model that passes your evals, in that order. Track cost per finished task per task type and judge every change side by side on the same checks. Kernels and speculative decoding come after that baseline exists.

How can a small team reduce LLM inference cost without touching kernels?

Pick the smallest model that passes your evals, reuse cached prompt prefixes, send work that can wait through a batch option, and distill repetitive jobs into a small model. Measure every change as cost per successful task.

Sources

  1. DeepSeek DeepInfer repository on GitHub github.com
  2. djcroman: DeepSeek open sources DeepInfer (21 Oct 2026) djcroman.com
  3. GraphWiz: LLM Inference Kernels, the open source arms race graphwiz.ai
  4. Guozhen: ForgeKernel beats FlashMLA by 9.8 percent (30 Oct 2026) zglg.work
  5. AI Herald: Hugging Face revamped kernels cut LLM inference costs artificialintelligenceherald.com
  6. Safeguard: cheapest LLM inference explained safeguard.sh

Talk to me

Building an AI product and need someone senior to own the technical side? Book a free 30-minute call.