vllm.model_executor.model_loader.checkpoint_digest
¶
Content digest of the checkpoint files a model was loaded from.
Classes:
-
CheckpointRecording–Records the checkpoint files read while loading the model
owner.
Functions:
-
record_checkpoint_files–Record the checkpoint files read while loading the model
owner.
CheckpointRecording
¶
Records the checkpoint files read while loading the model owner.
Files of other models, such as a draft model loaded alongside, are not part of the digest.
With hash_local_files, files outside the Hugging Face cache are hashed
in the background as soon as they are recorded, while the weights load,
so the bytes are mostly read from the page cache the load fills.
Methods:
-
digest–Digest the recorded files.
Source code in vllm/model_executor/model_loader/checkpoint_digest.py
digest(model_config, load_config)
¶
Digest the recorded files.
The digest covers each file's path relative to its checkpoint folder and its SHA-256, so a Hub-cached checkpoint and a local copy of the same files match. Without SHA-256s for every file, and for loaders that do not record their files, it falls back to the model path and revision, which cannot tell two checkpoints at the same path apart.
Returns:
-
dict[str, str]–weights, the digest, andweights_source: one ofhf_cache, -
dict[str, str]–hashed,pathordummy.
Source code in vllm/model_executor/model_loader/checkpoint_digest.py
_hf_cache_sha256(path)
¶
A Hugging Face cache snapshot links each LFS file to blobs/<sha256>.
Only that link is read: the blob may itself link into a store that names files by another hash.
Source code in vllm/model_executor/model_loader/checkpoint_digest.py
record_checkpoint_files(owner, folder, files)
¶
Record the checkpoint files read while loading the model owner.