[FUCK] remove fastsafetensors#5371
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request removes the fastsafetensors dependency from the codebase and consolidates on using the standard safetensors library (version >=0.7.0). The PR eliminates the custom fastsafetensors loading mechanism and associated workarounds, simplifying the weight loading infrastructure.
Key Changes:
- Removed
fastsafetensorsdependency from all requirements files and updatedsafetensorsto version >=0.7.0 - Removed
fastsafetensors_weights_iteratorandload_tp_checkpoint_v1functions from weight loading utilities - Removed
use_fastsafetensorconfiguration option and related environment variable - Removed the
_patch_fastsafetensors()workaround function from package initialization
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| requirements_metaxgpu.txt | Removed fastsafetensors==0.1.14, updated safetensors from ==0.7.0rc0 to >=0.7.0 |
| requirements_iluvatar.txt | Removed fastsafetensors==0.1.14, updated safetensors from ==0.7.0rc0 to >=0.7.0 |
| requirements_dcu.txt | Removed fastsafetensors==0.1.14, updated safetensors from ==0.7.0rc0 to >=0.7.0 |
| requirements.txt | Updated safetensors from >=0.7.0rc0 to >=0.7.0 |
| fastdeploy/model_executor/load_weight_utils.py | Removed fastsafetensors imports and related functions; simplified load_composite_checkpoint to use standard safetensors loading only |
| fastdeploy/envs.py | Removed FD_USE_FASTSAFETENSOR environment variable |
| fastdeploy/engine/engine.py | Updated regex pattern to remove "fastsafetensors" from checkpoint loading progress detection |
| fastdeploy/engine/async_llm.py | Updated regex pattern to remove "fastsafetensors" from checkpoint loading progress detection |
| fastdeploy/config.py | Removed use_fastsafetensor configuration field from LoadConfig |
| fastdeploy/init.py | Removed subprocess and sys imports; removed _patch_fastsafetensors() function and its invocation |
Critical Issues with PR Metadata:
-
PR Title: The title "[FUCK] remove fastsafetensors" contains unprofessional language. According to the project's PR guidelines, titles should follow the format
[TAG]Titlewhere TAG should be one of the standard tags like[BugFix],[Feature],[Optimization], etc. Please change the title to something professional like[Optimization] Remove fastsafetensors dependencyor[Feature] Remove fastsafetensors dependency. -
PR Description: The PR description is incomplete. According to the guidelines, it should include:
- Motivation: Why is fastsafetensors being removed? (e.g., "The fastsafetensors library is no longer needed as safetensors>=0.7.0 provides all required functionality")
- Modifications: A clear list of what was changed (e.g., removed fastsafetensors dependency, removed related code, updated safetensors version constraints)
- Testing: How this change was tested to ensure no regression
Please update the PR metadata before merging.
| def load_pre_sharded_checkpoint(model_path: str, local_rank: int, use_fastsafetensor: bool = False): | ||
| def load_pre_sharded_checkpoint(model_path: str, local_rank: int): | ||
| """ | ||
| load_pre_sharded_checkpoint |
There was a problem hiding this comment.
The function signature for load_pre_sharded_checkpoint has been modified to remove the use_fastsafetensor parameter. However, the docstring still just says "load_pre_sharded_checkpoint" without describing the function's purpose or its parameters. Consider updating the docstring to reflect the current function signature and provide a meaningful description of what the function does and what parameters it expects.
| load_pre_sharded_checkpoint | |
| Loads a pre-sharded checkpoint for a given model and local rank. | |
| Args: | |
| model_path (str): Path to the model directory containing checkpoint shards. | |
| local_rank (int): The local rank (shard index) to load. | |
| Returns: | |
| dict: A state dictionary mapping parameter names to their corresponding tensors. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5371 +/- ##
==========================================
Coverage ? 59.78%
==========================================
Files ? 325
Lines ? 40207
Branches ? 6086
==========================================
Hits ? 24039
Misses ? 14276
Partials ? 1892
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for your contribution! |
Motivation
*** for #5330
Modifications
Usage or Command
Accuracy Tests
Checklist
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.