Baseten published an account of how it optimized DeepSeek V4.1 Flash 1017, an open 552B-parameter mixture-of-experts model with 8B active parameters during prefill and 16B during decode. The company reports the optimized variant, called Fast, reaches 991 output tokens per second on Artificial Analysis and sits on the lowest time per task Pareto frontier. The work covered more than 80 kernels and bottlenecks, using three techniques closest to the hardware layer: kernel fusion, Programmatic Dependent Launch (PDL), and host loop minimization.
Kernel fusion
CUDA kernels execute steps like matrix multiplication and addition in parallel on NVIDIA GPUs. When one kernel's output feeds another kernel's input, that data makes a round trip through VRAM. Kernel fusion combines two or more kernels so intermediate results stay in fast on-chip memory, avoiding the round trip and cutting kernel launch overhead.
A simple example is QK-norm. Without fusion, the chain runs normalize Q, normalize K, then apply RoPE to each, with Q and K passing through VRAM between every step. The fused version reads Q and K once, normalizes and applies RoPE to both, then writes the final tensors.
A more complex case is the mixture-of-experts layer. A fused MoE kernel combines routing tokens to experts, the expert linear projections, the activation, and the gather into a single function. Baseten engineered an improved fused router kernel that decreases decode time by 2.7 milliseconds. The team sampled the model to get outputs within its distribution, then ran an internal kernel harness for fusion while maintaining numerical precision.
The third example is the mHC kernel, which handles Manifold-Constrained Hyper-Connections, a form of residual connection with multiple streams and learned pre/post mappings. Baseten improved on the open-source megakernel for mHC in DeepInfer, reporting a 30% speed increase at batch size 1 with lower latency.
Programmatic Dependent Launch
Decode still runs hundreds of kernels in serial order because later kernels depend on data from earlier ones. PDL lets kernel B start its preamble, which handles zeroing buffers and prefetching weights from VRAM into on-chip memory, before kernel A fully finishes. Kernel A signals via cudaTriggerProgrammaticLaunchCompletion that B may launch, and B runs independent work before blocking via cudaGridDependencySynchronize until A's results are available.
On B200 Blackwell GPUs, the overlap is grid-granular: B's blocks can start, but dependent work waits for every thread block of A to flush. On Vera Rubin, the dependency is finer-grained, so a consumer thread block can begin as soon as the data it needs lands. Baseten applied PDL to the mHC kernel, where a threadblock prefetches its slice of the mHC fixed weights into L2 without waiting for the residual stream to complete. The company notes NVIDIA previously cited an expanded PDL implementation as one reason behind its 2.8x Blackwell throughput gains on DeepSeek-R1.
Host loop minimization
The CPU can also bottleneck performance. The host loop is a CPU-side control loop that prepares inputs and launches kernels. In SGLang, which serves DeepSeek V4.1 Flash, the Python scheduler is the host loop. Python is slow, so kernels often finish before the scheduler queues the next ones. This matters less for larger models with longer-running kernels, but on flash models with fewer active parameters on fast hardware, the scheduler constrains throughput.
Baseten leaned into CUDA graphs, which record a sequence of GPU operations and play the whole sequence through a single host launch. Decode has the same shape every step with a fixed number of tokens per sequence, so the whole pass can be captured in one CUDA graph per batch size. Prefill is harder because input lengths vary, so the team turned on breakable CUDA graphs in SGLang, grouping kernels into a minimal set of graphs that reduces the number of launches and eliminates GPU idling between kernels.
Sources & references
Baseten: How to make flash models even faster: optimizing DeepSeek V4.1 Flash 1017 ↗Source consulted: 2026-11-16



