
Inference R&D at https://xitter.cf/t.co/C8Vz08a4XZ
Pune, Maharashtra India
Joined September 2023
- Tweets654
- Following1.1K
- Followers495
- Likes2.4K
Total number of kernels = number of fused groups + number of external kernels calls like cuBLAS library.
This is the small view of torch.compile and how at the end it gets decided how many gpu kernels gets created for our models inference.
Focus on top right blog diagram ๐ฅธ
10
277
Tried 9 different torch.compile Inductor settings on Qwen3-0.6B running on an NVIDIA A30.
Most made little to no difference.
combo_kernels was the only one that noticeably helped, reducing decode latency by 1.5%. Adding coordinate_descent_tuning pushed it to 2.1%.
Interestingly, max_autotune had no effect. Turns out Inductor skips Triton matmul autotuning on GPUs with fewer than 68 SMs. The A30 has just 56.
2
8
381
Tested a small vLLM startup win today. It saved 18 s, and it had nothing to do with GPUs.
vllm serve imports ~35,000 Python files. Images built with uv had no .pyc files, so every fresh container compiled them all again.
vLLM โฅ 0.32.0 ships precompiled bytecode.
Qwen3.8-27B, 1ร H100: 107.6 s โ 89.6 s
I like this way of taking notes. It keeps my things connected in one freeform board. Whenever i have to find something I checks the scenes from freeform app then gets everything else connected to it there. I came to explore the torch inductor and got revise everything related to CUDA in a couple of minutes.
Not revised but got connected to it.
3
226
I have started using concepts app in the iPad and loving it so much for brainstorming. Previously I was using Freeform which was lagging for bigger boards.
6
154
Spent last week working on image generation models: inference scaling, billing, error handling, safety services like prompt and output filtering, XML metadata, and C2PA for generated content. Now, in parallel with work, planning a blog series on image model architectures and infrastructure techniques.
This will be a strong experimental guide on KV cache quantization. Going forward, before deploying any model with vLLM, we should first check how many attention layers it has, then choose the KV cache quantization type that gives us extra concurrency with little or no accuracy loss.
making it live soon
3
6
267
1ร H200 GPU = 3 images/sec = 10,800 images/hour = ~259,000 images/day.
benchmarked FLUX.2 klein 4B on a single H200 (1024ร1024, 4 inference steps).
At just 4 concurrent requests, the GPU had already reached its maximum throughput.
I pushed concurrency all the way to 32. The result? Still around 3 images/sec, but p95 latency climbed to 53 seconds.
So, adding more requests wasn't making image generation faster. It was just making users wait longer.
And if I wanted to serve 10 images/sec, I'd need roughly 4 H200 GPUs, assuming the same per-GPU throughput.
The hourly and daily numbers assume continuous operation at peak throughput.
5
153
Today was quite a day of runs for me, with lots of concurrency, stress, spike, and soak testing for FLUX Klein 4B image generation on an H200 GPU.
Been experimenting with FLUX.2 klein 4B image generation on a single H200 on @jarvislabsai and vLLM Omni as inference engine.
With prompt and image safety checks enabled, increasing per-worker concurrency from 1 to 8 improved throughput from ~0.68 to 2.61 images/sec (~3.8ร).
Beyond 8, throughput plateaued while tail latency increased.
Sharing the benchmark graph and a few generated images.
๐ค Made with AI
Spent the day on the image generation model inference pipeline. Production deployment involves multiple steps: prompt filters, image generation, output filtering, adding AI-generated labels, metadata, and image rendering. We must consider all these in detail. Since this isn't common practice, we decide ourselves through experiments, hypothesis testing, etc.
5
118
I was curious about the architectures behind today's open image generation models, so I compared the architectures of 21 models available on Hugging Face.
16 out of 21 use Diffusion Transformers (DiT) as their main architecture, including Qwen-Image, FLUX, Z-Image, SD 3.5 and others.
Most follow a similar pipeline:
Text Encoder โ DiT โ VAE Decoder
The DiT gradually transforms noise into an image representation over multiple steps (often 20โ50), and the VAE decodes it into the final image.
Model sizes vary quite a bit:
Sana: 1.6B parameters
Qwen-Image-2512: 20B
FLUX.2 dev: 32B
HunyuanImage-3.0: 80B total (13B active)
Some models combine image understanding and generation, like HunyuanImage-3.0, HiDream-O1 and Cosmos3. Older models like SDXL and Kolors still use U-Net architectures.
Video generation shows a similar trend. 14 out of 16 open video models in the comparison use DiT architectures.
Let's explore how DiT works under the hood.
4
231
I ran another set of KV-cache quantization experiments on Qwen3.8-27B in vLLM, this time using Terminal-Bench 2.1 to test agentic performance.
Here are the results on 1ร H200:
โ BF16 (FlashAttention): 74.2%
โ FP8 KV: 76.8%
โ BF16 (FlashInfer): 76.4%
โ FP4 KV: 77.2%
FP4 scored the highest, but that doesn't necessarily mean it's better.
Compared with BF16 using the same attention backend, FP4 improved by just 0.8 percentage points, with a 95% confidence interval of โ4.1 to +5.6 points.
Even switching between FlashAttention and FlashInfer with BF16 changed the score by 2.3 points.
Agentic benchmarks are sensitive to small changes. A single different token can change the entire execution path.
Across RULER, DocVQA, MRCR, and now Terminal-Bench, I haven't observed a statistically significant accuracy difference from FP8 or FP4 KV-cache quantization. Meanwhile, FP4 provides 3.3ร more KV-cache token capacity than BF16.
One possible reason is Qwen3.8's hybrid architecture. Only 16 of its 64 layers use full attention with a KV cache. The remaining 48 use linear attention with a fixed-size state that KV-cache quantization doesn't affect.
To investigate this further, I'm running the same experiments on Gemma 4 31B. All 60 layers use attention with a KV cache (50 sliding-window + 10 global), so quantization affects every layer.
I'm curious to see whether the results change on a model where every layer uses a KV cache.
Last time, I tested FP4 KV cache on ๐ค๐๐ฒ๐ป๐ฏ.๐ด ๐ฎ๐ณ๐ using vLLM. The results looked promising, but I wanted to see how it performs with really long contexts.
So this time, I ran ๐ ๐ฅ๐๐ฅ (๐ ๐๐น๐๐ถ-๐ฅ๐ผ๐๐ป๐ฑ ๐๐ผ๐ฟ๐ฒ๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ฐ๐ฒ ๐ฅ๐ฒ๐๐ผ๐น๐๐๐ถ๐ผ๐ป).
MRCR places several almost identical requests inside a long conversation and asks the model to recall one specific answer. It's a good way to test whether KV cache quantization affects the model's ability to retrieve details from earlier in the context.
I tested ๐ฐ๐ณ๐ฑ ๐ฝ๐ฟ๐ผ๐บ๐ฝ๐๐, ๐ฟ๐ฎ๐ป๐ด๐ถ๐ป๐ด ๐ณ๐ฟ๐ผ๐บ ๐ญ๐ฒ๐ ๐๐ผ ๐ฎ๐ฐ๐ฐ๐ ๐๐ผ๐ธ๐ฒ๐ป๐, comparing FP8 and FP4 KV cache.
๐ฅ๐ฒ๐๐๐น๐๐ (๐๐ฃ๐ด ๐๐ ๐๐ฃ๐ฐ):
โ 16K: 99.6 vs 98.5
โ 32K: 96.6 vs 95.6
โ 64K: 95.2 vs 94.7
โ 128K: 97.9 vs 95.9
โ 244K: 98.0 vs 97.5
๐ข๐๐ฒ๐ฟ๐ฎ๐น๐น: ๐ต๐ณ.๐ฐ ๐๐ ๐ต๐ฒ.๐ฐ
I was surprised by how well FP4 performed. Even at 244K tokens, the accuracy stayed close to FP8.
The overall difference was just ๐ญ ๐ฝ๐ฒ๐ฟ๐ฐ๐ฒ๐ป๐๐ฎ๐ด๐ฒ ๐ฝ๐ผ๐ถ๐ป๐, while FP4 allowed roughly ๐ญ.๐ณร ๐บ๐ผ๐ฟ๐ฒ ๐๐ผ๐ธ๐ฒ๐ป๐ to fit in the KV cache.
๐ง๐ฒ๐ฟ๐บ๐ถ๐ป๐ฎ๐น-๐๐ฒ๐ป๐ฐ๐ต ๐ฎ.๐ญ has been running for the last 3 days. A few tasks have timed out, so I'm still waiting for the remaining results.























