Skip to content

fix(self-host): harvest non-weight siblings into slug_dir (cherry-pick #9610)#9652

Merged
saturley-hall merged 1 commit into
release/1.2.0from
krish/cp-9610
May 17, 2026
Merged

fix(self-host): harvest non-weight siblings into slug_dir (cherry-pick #9610)#9652
saturley-hall merged 1 commit into
release/1.2.0from
krish/cp-9610

Conversation

@krishung5
Copy link
Copy Markdown
Contributor

@krishung5 krishung5 commented May 16, 2026

Cherry-pick of #9610 (94771a9) onto release/1.2.0.

…9610)

Signed-off-by: nnshah1 <neelays@nvidia.com>
(cherry picked from commit 94771a9)
@krishung5 krishung5 requested a review from a team as a code owner May 16, 2026 01:04
@github-actions github-actions Bot added the fix label May 16, 2026
Comment thread lib/llm/src/model_card.rs
let mut snapshot_dirs: std::collections::HashSet<PathBuf> =
hf_snapshots.values().cloned().collect();
for (uri, _) in &entries {
if let Some(parent) = file_uri_parent(uri) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file_uri_parent is applied to every file:// metadata entry, including custom chat-template files whose parent may be unrelated to the model, so a template in /tmp can import unrelated files into slug_dir and can nondeterministically overwrite valid harvested siblings from the HF snapshot. Fix: carry the is_custom flag through entries and only add file parents for non-custom model metadata or for an explicit local model directory.

Comment thread lib/llm/src/model_card.rs
}
}
for snap in &snapshot_dirs {
harvest_siblings(snap, &slug_dir, &typed_filenames)?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reusing the same mdcsum directory and only relinking siblings that currently exist leaves previously harvested untyped files behind when a later snapshot with the same typed checksums removes them, causing from_pretrained(slug_dir) to see stale configuration. Fix: delete non-typed entries from slug_dir before harvesting or populate a fresh staged slug directory and atomically publish it.

@saturley-hall saturley-hall merged commit 68b4896 into release/1.2.0 May 17, 2026
97 of 99 checks passed
@saturley-hall saturley-hall deleted the krish/cp-9610 branch May 17, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants