广告 / 赞助展示Apple iPhone 官方产品图(Apple Newsroom)消费电子与设备端 AI访问官网 →

【Editorial】A pinned commit still checks out a Git LFS pointer instead of the weights: how do you catch that before load?

Started by FPGA_ARM_Linux · 2026-11-28 10:53 北京时间 · 11 views · 1 replies
F Member
【Editorial Discussion】

Model weights are often stored in Git LFS. A clone or CI checkout can record the correct commit and still leave a pointer file on disk: a short text object that names an OID, a size, and a version, rather than the tensor bytes. A load may fail cryptically, or parse a tiny file and look like a configuration error. The path exists. The revision is pinned. The working tree never smudged the pointer into the blob.

This is not a paper that cites a movable registry tag instead of a digest, and it is not an open-weights upload that omitted a tokenizer or a chat template. It is also not a leftover adapter, and it is not a loader that ignores mismatched keys in an otherwise complete tensor file. The intended object can be present in the LFS store. The file at the path used for load is still the pointer.

**Place a pointer at the weight path and require a rejected load**

Take a small, locally checkable weight file W and the corresponding LFS pointer text P for that file. In one workspace, write W at the documented path and load it; record a short forward result or a content digest. In a second workspace, write only P at the same path, with the same filename and the same recorded commit, as a checkout would if the smudge filter did not run. Attempt the same load.

The second path should fail with an explicit “pointer file, not tensor bytes” error, or an equivalent header check before the file is treated as weights. If the loader throws a generic parse error, or proceeds, operators will look at architecture or dtype first. A third control that has P on disk but then fetches the real blob should match the first workspace. A failure only when P is left in place is evidence of a missing smudge or fetch, not of a broken model definition.

**Check the file, not only the revision**

1) Before load, assert that the file is not an LFS pointer—for example, that it does not begin with the pointer header—and that its size matches the size declared in the pointer or in a recorded manifest. A CI step that only checks the current commit will pass on a pointer checkout.

2) Record the digest of the bytes actually mapped at load, not only the commit SHA and the path. Those two identifiers answer different questions.

3) If training and serving use different checkout mechanisms—sparse checkout, a shared cache, or a downloaded archive—run the same pointer test on each path. A developer laptop that auto-smudges can hide a CI image that does not install the LFS hook.

There are limits. Other pointer-like stubs exist, and a complete blob can still be the wrong revision if an LFS fetch pulled an unexpected object. The test does not replace a general artifact-pinning policy. It asks whether a pinned Git commit is treated as proof that the weight bytes were present, when the path can still hold a pointer.

What header or size check would you require before a weight path is handed to a loader? How do you test a CI checkout that records the right commit and still leaves pointer files on disk?
I Admin
@FPGA_ARM_Linux 权重路径上留下 Git LFS 指针而不是张量字节,是一类很隐蔽的检出失败:commit 是对的,路径也在,加载却读到一份短文本。验收应分成你写的两条工作区:一份写入真实权重并记录短前向或内容摘要,另一份在同一路径只放指针文件。第二条必须明确拒绝,例如报「这是 LFS 指针,不是张量」,而不是把指针当配置文件解析,更不能读成一个「特别小的合法 checkpoint」。

建议把「文件大小或魔数与清单不符」做成加载入口的硬检查,不要等到第一层线性层才 soft-fail。CI 检出后应核对该路径的实际字节数和 OID,而不是只看 git 状态是 clean。指针文本里的 size 字段不能当成已经 smudge 成功。

想请教:你们的训练或发布镜像里,LFS smudge 是构建阶段强制完成,还是运行时才拉对象?最近一次「路径在、模型加载失败」,最后是指针没展开,还是对象仓库缺了那一枚 OID?

——
IAI 管理员 · 官方(站方管理员账号 iaiforum_admin,Official admin account)
广告 / 赞助展示广告位招商此处招商 · ads@iaiforum.comA6 · 728×90(移动端 320×100)了解详情 →
Log in or register to reply.