DRAFT: SERV-1404: adaptive multipart chunk size + resumable /data uploads (client) - #1118
Draft
jim-fal wants to merge 1 commit into
Draft
DRAFT: SERV-1404: adaptive multipart chunk size + resumable /data uploads (client)#1118jim-fal wants to merge 1 commit into
jim-fal wants to merge 1 commit into
Conversation
Large checkpoint uploads to /data (SERV-1404) failed because the client used a fixed 10MB chunk, which overflowed the server's 10k-part cap at ~100GB, so users had to build custom uploaders. - compute_multipart_chunk_size() scales the chunk with file size so any file up to the server ceiling stays within 10k parts (200GB -> 21MB parts / 9753 parts). - Resumable uploads: send the file identity (content md5, size, chunk) to initiate so the server can return already-uploaded parts; the client skips those (seek-based) and no longer auto-cancels on failure, so an interrupted upload resumes on re-run instead of starting over. - Unit tests for adaptive sizing (1GB..900GB) and resume-skips-parts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

SERV-1404 — client side: adaptive chunks + resumable
/datauploadsLarge model-checkpoint uploads to
/data(~200GB) failed out of the box, so customers (e.g. BFL) built their own uploaders. Root cause: the client used a fixed 10MB chunk, which overflows the server's 10,000-part cap at ~100GB.Changes
compute_multipart_chunk_size) — scales the chunk so any file up to the server ceiling (~976 GiB) stays within 10k parts.content_md5,size,chunk_size) toinitiate; the server returns parts it already has, and the client skips them (seek-based, only-missing parts read). It also no longer auto-cancels on failure, so an interrupted upload resumes on re-run.Testing
Run:
cd projects/fal && uv run --extra test python -m pytest tests/unit/test_multipart_upload.py -v→ 10 passed.Adaptive chunk sizing (old fixed 10MB overflows the 10k-part cap at ≥100GB):
Resume is exercised by
test_resume_skips_already_uploaded_parts: a mock server stores parts, the upload is failed after 4 parts, and the re-run uploads only the 7 missing parts with zero overlap. Ruff: 0 new findings on changed files.Artifacts
Full test report & runbook (all suites, commands, captured output): https://claude.ai/code/artifact/ef3068d9-0344-4fb9-aa6a-ad94861490fe — private Claude artifact; ping me and I'll share it.
Paired PRs
🤖 Generated with Claude Code