Repository navigation
fix(inference): DeepSeek V4 C128 compressor and attn_sink loading patches - #4040
Merged
Merged
Conversation
…CUDA graphs vLLM 0.30+ (vllm-project/vllm#55353) derives the compressor's c128_boundary flag from seq_lens_cpu_upper_bound, which Model Runner V2 sets. Piecewise CUDA graph capture then records the early return on dummy batches, so mixed batches never write C128 compressed KV and decode drifts from prefill as context grows (upstream fix pending in vllm-project/vllm#59709). Returning None from _get_c128_boundary restores 0.29 behaviour. On the 131k SWE run with bf16 serving this takes step-1 mismatch KL from 0.0070 back to 0.0005, the pre-rebase level. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ight loaders DeepseekV4Model.load_weights writes the attention sinks with a bare params_dict[name][:n].copy_(narrow_weight) instead of going through param.weight_loader. Layerwise reload moves a layer's tensors to meta and wraps each loader to buffer the incoming tensor, so that copy lands in a meta tensor and is discarded silently: load_numel stays 0, finalize restores the boot value with only a warning, and the loader still does loaded_params.add(name), so a named_parameters() - loaded_params diff cannot see the loss either. Attention sinks are trainable, so every weight update keeps serving the sinks the server booted with. Padding this rank's heads back up with -inf, the parameter's own init value, makes it an ordinary full-parameter load through the existing loader contract. Still required on vLLM 0.31.0 (model.py:1755). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mikasenghaas
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DeepSeek V4 serving on vLLM 0.31.0 corrupts long-context KV under piecewise CUDA graphs and drops the attention sinks on every layerwise weight reload. Two vLLM patches fix both.
param.weight_loader.apply_shared_vllm_patches, so a failing DeepSeek V4 import cannot skip the other patches.🤖 Generated with Claude Code