mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2902] setup: SHA-256 check is wrong for large shards and deletes correct files #1175
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1175
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Astemiir on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2902
Summary
The SHA-256 check in
setup.pyis wrong for large files (the failures we see are 43–50 GB shards): it rejects a correct file, deletes it, downloads it again, and the next attempt fails the same way. Small files hash fine, so the bug only shows on the big model shards.What happens
After a fresh 49.8 GB download the check reports another value (
ec899c68…); shard 3 (43.8 GB) fails the same way (e2f8d605…vs expectedd4634e6d…).Proof that the bytes are fine and the check is not
certutil -hashfile <file> SHA256):577a38a2…— exactly thelfs.oidthe Hub publishes forunsloth/Qwen3.8-Flash-Next-GGUF, both onmainand on the commit pinned insetup.py(38bb39ee…).d4634e6d…— its Hub oid. Setup's own check on those same bytes saide2f8d605…and deleted the file.Environment: Windows 10 19045, Python 3.13.13, Strata 0.1.45.
Correct way to verify these files
Use an external hasher instead of
hashlib:certutil -hashfile "<file>" SHA256shasum -a 256 "<file>"and compare the result with the file's
lfs.oidfrom the Hub API(
https://huggingface.co/api/models/<repo>/tree/<ref>/<dir>?expand=true).Also: do not delete on a mismatch
Rename the file to
<name>.badand keep it. Then a mismatch costs a re-check, not another 50 GB download, and the user still has the bytes for a manual verification.Workaround for users today
Put
<file>.donenext to the file containingsha256 <expected>—verify_sha256then skips the check. Thewhole (checked against its own tensor directory)form written bywhole_shardis not enough for a pinned hash: it still re-hashes.@Astemiir commented on GitHub (Oct 17, 2026):
Short version, @Niko1221:
verify_sha256insetup.pygives a wrong SHA-256 on large files (our failures are 43–50 GB shards). Small files are fine, so it only shows on the model shards.certutil -hashfile <file> SHA256on the same file returns exactly the Hub'slfs.oid(577a38a2…for shard 2,d4634e6d…for shard 3), while setup reportedcd6e4093…/e2f8d605…and deleted both.certutil -hashfile "<file>" SHA256on Windows,shasum -a 256 "<file>"on macOS/Linux — and compare with thelfs.oidfrom the Hub API. Treated as a bug in the hashing path, not in the download.<name>.badand keep it. Then a wrong check costs a re-check, not another 50 GB download.<file>.donecontainingsha256 <expected>makes setup skip the check (whole (checked against its own tensor directory)is not enough for a pinned hash).@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.