test(planner): avoid materializing zero-filled shard payloads - #1439
Open
bherald wants to merge 1 commit into
Open
test(planner): avoid materializing zero-filled shard payloads#1439bherald wants to merge 1 commit into
bherald wants to merge 1 commit into
Conversation
bherald
marked this pull request as ready for review
September 11, 2026 22:11
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.
The planner tests use safetensors fixtures whose tensor payloads are all zero. One disk-bound model case creates four 3 GB payloads, materializing those bytes in Python and writing them to temporary storage even though the planner only needs the headers and file sizes.
This changes the fixture writer to write the header and extend the file to its expected length. It preserves tensor offsets, logical file size and zero-valued payload bytes without allocating the payload in Python. Filesystems supporting sparse extension also avoid the large disk writes.
A fixture integrity test verifies offsets, final length and zero-valued reads. Runtime code is unchanged.
Verification:
python3 -m unittest tests.test_env_defaults tests.test_resource_planpasses all 90 tests. Before the change, the same selection ran 89 tests and failed the large-model fixture withOSError: [Errno 28] No space left on deviceon a checkout with limited temporary storage.