Repository navigation
[Bugfix][RL] Load DeepSeek V4 attention sinks through weight_loader - #57798
Ronald1995 wants to merge 3 commits into
Conversation
|
Documentation preview: https://vllm--57798.org.readthedocs.build/en/57798/ |
ad7c401 to
03d130b
Compare
Checkpoint-backed attention sink parameters are loaded with a bare copy_ in
several model load_weights implementations:
param.data.copy_(narrow_weight)
params_dict[name][:n].copy_(narrow_weight)
That write bypasses param.weight_loader, which is the only entry point the
online weight reload path can observe. During RL / online weight update /
layerwise reload the parameter is on meta, so the write lands on the parameter
instance the reload materialized and the framework has no record that the sink
was loaded. Measured through a real layerwise reload cycle, the restored kernel
tensor then holds unwritten storage rather than the new value, and the -inf
padding tail is not re-established either.
Add a design doc specifying the contract (every checkpoint-backed,
online-updatable parameter loads through the parameter's current
weight_loader), the measured failure mode, the 20 confirmed sites across 19
files, the shared padded-sink helper for DeepSeek, and the staged
implementation plan.
Implementation PRs: vllm-project#57797, vllm-project#57798, vllm-project#57799, vllm-project#57800, vllm-project#57801, vllm-project#57803, vllm-project#57804,
vllm-project#57805, vllm-project#57806.
Co-authored-by: AI Assistant <noreply@example.com>
f95c283 to
db0ce2c
Compare
db0ce2c to
be0177f
Compare
Signed-off-by: Ronald1995 <ronaldautomobile@163.com>
0b1e7a6 to
555c43f
Compare
The DeepSeek V4 target, MTP and DSpark loaders all wrote the attention sink with a bare copy_ after slicing the checkpoint tensor by head range, so a live reload replaced the runtime parameter with a materialized one whose sink was never written, and the padded heads lost their -inf tail. All ten call sites (CPU/XPU/AMD/NVIDIA target and XPU/AMD/NVIDIA draft) now pass the checkpoint tensor and rank head range to the shared load_padded_attn_sink helper from the loader package, which takes the slice once, rebuilds the padded runtime representation and calls the parameter's current loader. Signed-off-by: Ronald1995 <ronaldautomobile@163.com>
fe9fc69 to
5caa04a
Compare
Signed-off-by: Ronald1995 <ronaldautomobile@163.com>
5caa04a to
842d641
Compare
Verification on H20Verified commit: Environment
Results
The GPU script drives a real layerwise reload ( Pre-commitNo hook rewrote a file. Not verified
What changed in this revision
|
Fix DeepSeek V4 target, MTP, and DSpark sink loading in one model-family PR. The 10 changed call-site files cover CPU/XPU/AMD/NVIDIA target models and XPU/AMD/NVIDIA draft models.
Each site passes its checkpoint tensor and rank head range to
load_padded_attn_sinkfrom #57797. TP slicing remains in that helper and happens once. The helper builds the full padded runtime tensor and calls the current parameter loader.Dependency: #57797. Because the shared helper branch is in a fork, GitHub currently compares this PR with upstream
mainand also displays the two helper files. The V4-only delta is here. After #57797 merges, this PR can be rebased ontomainand its helper files will disappear from Files changed.Validation
The V4-only diff contains 10 model call-site files;
ruff check,ruff format --check, andgit diff --checkpass on the reconstructed combined tree.Static validation on the integrated final tree:
ruff check,ruff format --check,git diff --check, and test tethering pass. The source audit passes 28 tests. The new runtime tests have not been executed, as requested.AI assistance
AI assistance was used.