Skip to content

Keep Xet downloads from restarting near the end of large shards - #795

Open
franz101 wants to merge 2 commits into
Blaizzy:mainfrom
franz101:fix/xet-download-stall
Open

franz101 wants to merge 2 commits into
Blaizzy:mainfrom
franz101:fix/xet-download-stall

Conversation

@franz101

@franz101 franz101 commented Oct 30, 2026 •

Copy link
Copy Markdown

Problem

Large Xet-backed downloads (e.g. dima6312/Flint-40B-A2.5B-abliterated-MLX-4bit, nine ~4.7 GB shards) failed with "The model download stopped responding after multiple automatic retries."

  • The watchdog stopped an attempt after 60 s without progress, while swift-xet waits 120 s on a silent xorb fetch before retrying it. One slow range restarted every shard.
  • On slow connections, presigned xorb URLs expire during the download (HTTP 403). swift-xet 1.1.0 treats that as fatal.

Fix

Earlier revisions also shortened swift-xet's read timeout and retry delay, and deleted the partial file on SIGTERM. Both are dropped. With 1.1.1, the shorter timeouts only add retries on slow links. The partial file is needed to resume (#796).

Testing

  • HuggingFaceDownloadCapacityTests and LocalModelProviderTests pass.
  • mlx-community/Qwen3-32B-4bit (18.4 GB) on a ~12 MB/s connection: main failed after 59 min on its first attempt, with no shard complete. That is about when the xorb URLs expire.

@franz101 franz101 changed the title Keep Xet downloads from restarting near the end of large shards Make Xet downloads resumable and resilient on slow connections Oct 30, 2026
@franz101
franz101 force-pushed the fix/xet-download-stall branch 3 times, most recently from 8eda890 to 6be111e Compare October 30, 2026 16:12
@franz101
franz101 marked this pull request as draft October 30, 2026 16:14
@franz101

Copy link
Copy Markdown
Author

Draft until it's fixed in xet-swift

@franz101
franz101 force-pushed the fix/xet-download-stall branch from 6be111e to f4e903c Compare October 30, 2026 16:26
@franz101 franz101 changed the title Make Xet downloads resumable and resilient on slow connections Keep Xet downloads from restarting near the end of large shards Oct 30, 2026
swift-xet waits 120 s on a silent xorb fetch before retrying it, but the
download watchdog stopped the whole attempt after 60 s without progress.
One slow range near the end of a multi-gigabyte shard therefore restarted
every file from zero, and after three attempts the download failed with
"stopped responding after multiple automatic retries".

Time out silent fetches after 30 s and retry sooner so swift-xet recovers
on its own, and give the watchdog room for its backoff. Each stopped
attempt also left its uniquely named .incomplete file behind, because
huggingface_hub only removes it when Python unwinds; the helper now
deletes its partial file when it is terminated.
swift-xet 1.1.1 refreshes presigned xorb URLs that expire during long
downloads, and starts a fetch's retries over while it keeps making progress.
Drop the shorter read timeout and retry delay, which on a slow link made
healthy fetches retry, and keep partial files when the helper is
terminated so an interrupted download can be resumed.
@franz101
franz101 force-pushed the fix/xet-download-stall branch from f4e903c to d686ed2 Compare November 1, 2026 23:17
@franz101

franz101 commented Nov 1, 2026 •

Copy link
Copy Markdown
Author

The fix of huggingface/swift-xet#28 got merged in xet-swift 1.1.1

@franz101
franz101 marked this pull request as ready for review November 1, 2026 23:44

This branch has not been deployed

No deployments
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.

1 participant