loader: diagnose a missing core tensor instead of just naming it (#586)#614
Merged
JustVugg merged 1 commit intoJul 25, 2026
Merged
Conversation
"missing model.norm.weight" told the user nothing about why, so JustVugg#586 took three rounds of back-and-forth to land on the real cause -- a container whose tail shards never downloaded. The maintainer's reasoning there is mechanical enough for the engine to do it: the final norm and lm_head are written into the LAST shards, so a truncated transfer indexes nearly every tensor and then dies on the first one from the gap. st_die_missing() reports what was actually found -- tensors indexed, shard files read, and what the filenames say about completeness. The HF layout declares its total in `-of-NNNNN`, so a gap is stated exactly ("declare 144 shards, but only 122 are here -- 22 MISSING"); the converter's out-NNNNN layout has no total, but contiguous numbering still shows the gap must be at the tail, which is the JustVugg#586 case. The conclusion follows that evidence rather than always advising a re-download: with every declared shard present it says so and asks for a bug report instead, since re-downloading could not help. Zero indexed tensors is reported as a --model path problem, which is a different failure wearing the same message. Wired into ld() and the fatal branch of the expert-tensor load. The non-fatal probe path keeps its one-line "missing" log -- it is called per expert and must not flood. Refs JustVugg#586, JustVugg#583
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.
Picks up the gap you identified at the end of #586:
That thread took three rounds to reach the answer, and the reasoning that got there is mechanical enough for the engine to do itself: the final norm and
lm_headare written into the last shards, so a truncated transfer indexes nearly every tensor and then dies on the first one from the gap.What it prints now
out-NNNNNconverter layout, truncated tail β @xbais's exact situation (125 files,out-00000..out-00121):HF layout, where
-of-NNNNNgives an authoritative total, so the gap is stated as a fact rather than an inference:The conclusion follows the evidence. With every declared shard present, advising a re-download would send the user round a loop that cannot help, so it flips:
Zero indexed tensors is a different failure wearing the same message, and is reported as one:
Gaps in the middle print
(GAPS in the numbering)rather than the tail inference, and a non-tail tensor name drops the "LAST shards" sentence, which would be false for an expert weight.Scope
st_die_missing()inst.h, wired intold()and the fatal branch of the expert-tensor load. The non-fatal probe branch atcolibri.c:1488keeps its one-linemissinglog on purpose β it runs per expert and must not flood. No loading behaviour changes; this only replacesfprintf + exit(1)on paths that were already fatal.Verification
make -C c colibri ARCH=x86-64-v3clean,make check197 passed / 13 skipped.The five reporting branches were exercised directly, by building a throwaway harness that includes
st.hand hand-populates ashardsstruct (paths/n/nfd) for each layout β truncatedout-*tail, HF-of-gap, complete HF container, mid-numbering hole with an expert tensor name, and zero tensors. The outputs above are that harness's real output, not hand-written samples. The harness is not part of this PR since it would need a Makefile target of its own; happy to add it as a proper test if you'd rather have the branches locked down in CI.Not reproduced against a genuinely truncated 372 GB container β I don't have one β so the shard-arithmetic is verified against synthesised layouts, not a real interrupted download.