Repository navigation
tensor_file: remove parse_safetensors and Weights::from_bytes - #121
Merged
Merged
Conversation
Nothing outside the tests read a package out of a buffer. The tests now write their bytes to a temporary file and read it the way a model does, through the mapping. Also fixes the foundation test target on main, which #112 left naming the removed ParamSource. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ling0322
force-pushed
the
drop-in-memory-safetensors
branch
from
October 14, 2026 03:08
f4d0661 to
44db776
Compare
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.
Removes the in-memory safetensors path:
parse_safetensors,Weights::from_bytes, and the privatecollect_bytesandeach_copiedbehind them. Only tests used them. They now write their bytes to a temporary file and read it withread_safetensors/Weights::from_files, which is the mmap path models use.Also fixes
main: #112 added a Metal test that names&dyn ParamSource, which #118 removed. The two merged without a conflict, so thefoundationtest target onmaindoes not compile.Test changes
foundation.rsgainsread_bytesandweights_from, which go through aTempFile.stored,stored_typed,sourceand the corrupt-file cases use them.a_mapped_package_runs_like_one_read_into_memorynow compares the mapped package against the same weight put on the card withWeights::from_tensors. It needs CUDA and was not run here.says_that_low_vram_is_for_cuda_and_metal_alonecallsWeights::emptydirectly. That is where the refusal is checked, so theempty_filehelper is removed.Testing
./build/unittest: all pass.cargo test: 374 passed, 0 failed.--ignored) were not run.🤖 Generated with Claude Code