Skip to content

issue/467 [BUG]: enforce safetensors index-based weight loading for robustness - #469

Merged
pengcheng888 merged 1 commit into
InfiniTensor:mainfrom
rubik-hua:model.safetensors.index
Jul 3, 2026
Merged

pengcheng888 merged 1 commit into
InfiniTensor:mainfrom
rubik-hua:model.safetensors.index

Conversation

@rubik-hua

@rubik-hua rubik-hua commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Replace fragile glob with model.safetensors.index.json lookup to handle non-standard names (e.g., Mistral-Large-Instruct). Includes glob fallback

一般模型都包含model.safetensors.index.json文件,该文件描述了权重文件组成。

而有的模型,会有多种格式的权重文件,不能简单把所有safetensors文件加载到显存上。

image

模型验证:python examples/test_infer.py --device moore --model /home/rubik/models/Mistral-Large-Instruct-2411 --tp 8 --prompt 'introduce yourself'

image

为了验证不影响其它模型推理,其它模型验证截图
image
image
image
image
image
image

@rubik-hua
rubik-hua requested a review from a team June 30, 2026 08:54
Comment thread python/infinilm/infer_engine.py Outdated

@pengcheng888 pengcheng888 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

除了mistral_。请额外再测试一个模型,9g或qwen等。

@wooway777

Copy link
Copy Markdown
Collaborator

/test

@rubik-hua
rubik-hua force-pushed the model.safetensors.index branch 2 times, most recently from 60b50c1 to 5978c4e Compare July 2, 2026 08:37
@rubik-hua
rubik-hua requested a review from pengcheng888 July 2, 2026 08:46
@rubik-hua

Copy link
Copy Markdown
Contributor Author

@pengcheng888 @wooway777 已补充其它模型的验证

Comment thread python/infinilm/infer_engine.py Outdated
…obustness

Replace fragile glob with model.safetensors.index.json lookup to handle non-standard names (e.g., Mistral-Large-Instruct). Includes glob fallback
@rubik-hua
rubik-hua force-pushed the model.safetensors.index branch from 5978c4e to 442a875 Compare July 2, 2026 10:23
@rubik-hua
rubik-hua requested a review from pengcheng888 July 2, 2026 10:42
@pengcheng888
pengcheng888 merged commit 0ea50f2 into InfiniTensor:main Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants