Release the weight-checker snapshot once compare passes - #36561
Merged
yueming-yuan merged 2 commits intoAug 31, 2026
Merged
Conversation
yueming-yuan
force-pushed
the
yueming/weight-checker-release-snapshot
branch
from
August 26, 2026 23:13
13ba7e3 to
8b0c818
Compare
yueming-yuan
force-pushed
the
sglang-miles
branch
from
August 27, 2026 07:57
a6100a0 to
97e43b4
Compare
yueming-yuan
requested review from
AniZpZ,
BBuf,
CatherineSue,
Edwardf0t1,
FlamingoPg,
Fridge003,
HaiShaw,
JustinTong0323,
Qiaolin-Yu,
Ying1123,
b8zhong,
ch-wan,
fzyzcjy,
hnyls2002,
ispobock,
jybsuper,
key4ng,
kpham-sgl,
lifuhuang,
merrymercy,
mickqian,
mmangkad,
slin1237,
xiezhq-hermann,
yctseng0211,
yhyang201,
yuan-luo and
yushengsu-thu
as code owners
August 27, 2026 07:57
yueming-yuan
requested review from
ByronHsu,
DarkSharpness,
Duyi-Wang,
HydraQYH,
ShangmingCai,
YAMY1234,
celve,
hebiao064,
hubertlu-tw,
kkHuang-amd,
rainj-me,
sogalin and
yizhang2077
as code owners
August 27, 2026 07:57
yueming-yuan
force-pushed
the
yueming/weight-checker-release-snapshot
branch
from
August 27, 2026 08:06
8b0c818 to
c751ed0
Compare
yueming-yuan
force-pushed
the
yueming/weight-checker-release-snapshot
branch
from
August 27, 2026 16:24
c751ed0 to
f8e95be
Compare
Zhichenzzz
approved these changes
Aug 31, 2026
| # and freeing arena chunks does not shrink RSS (Grace/64K pages: even | ||
| # malloc_trim reclaims nothing). | ||
| named_params = [(name, param.data) for name, param in self._model_state()] | ||
| align = 64 |
Collaborator
There was a problem hiding this comment.
why is fixed to 64? should it be optional for input?
Collaborator
Author
There was a problem hiding this comment.
This is required, which is the same factor as torch allocator
Collaborator
Author
There was a problem hiding this comment.
comment added
yueming-yuan
force-pushed
the
yueming/weight-checker-release-snapshot
branch
from
August 31, 2026 18:46
893c325 to
cb916b8
Compare
yueming-yuan
added a commit
that referenced
this pull request
Sep 2, 2026
Kimi-K2.5 / Kimi-K3-VL time_weight and MiniCPM-V pos_embed / temporal_pos_embed are sincos tables built with torch.from_numpy, which ignores the construction device context, so they stay on the CPU as non-persistent buffers. No checkpoint and no weight sync carries them, yet the weight checker resets and compares them; a randomized copy nothing restores then fails every sync check on the model. This stayed hidden while the snapshot was param.detach().cpu(): for a CPU tensor .cpu() returns the tensor itself, so the snapshot aliased the live buffer and reset moved both sides at once. #36561's arena copy removed the alias and Kimi-K2.5's check has failed since. Mark them with the checker's existing per-tensor _skip_weight_check flag at the definition, the way kv-cache scales are marked. Weight-derived non-persistent buffers (Inkling's _w2_lin / _a_cat / _w1_delta, GGUF dequant caches) keep being checked: they are refreshed after every sync and the check is what proves that refresh ran.
This was referenced Sep 2, 2026
46 tasks
Zhichenzzz
pushed a commit
that referenced
this pull request
Sep 19, 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.
The snapshot is a host copy of every weight, and compare is its only consumer. Keeping it after a passed check holds weights-sized host memory for the process lifetime — 35 GB per TP8 rank on DeepSeek-V4-284B, observed idle for a full 10h RL run. A failed compare keeps the snapshot for debugging.
Evidence: on 8×GB300 colocated RL,
--check-weight-update-equalfires snapshot/reset/compare exactly once at init; the retained snapshot then contributes 4×35 GB/node to the host budget at every trainer sleep, and the job cgroup'smemory.eventsrecords boundaryoom_kills at the 898 GiB limit with the snapshot resident.Semantics: a second compare without a fresh snapshot now raises, matching the existing
test_without_snapshot_raisescontract; two new unit tests pin release-on-success and keep-on-failure. Fulltest_weight_checker.pysuite passes on GB300 (62 passed).CI States
Latest PR Test (Base): ❌ Run #33426900003
Latest PR Test (Extra): ❌ Run #33426899826
Latest PR Test (AMD ROCm 7.2): ❌ Run #33426899896