[Perf][Engram] Serialize offloaded lookups and pack host tables into huge pages (#56926)
Signed-off-by: Juntian Liu <Juntianl777@gmail.com> Co-authored-by: Kimi Code <noreply@moonshot.cn> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Kimi Code
Claude Fable 5.1
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
48d8880d09
commit
6936e77ba4
@@ -2,6 +2,7 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
import tempfile
|
||||
from unittest.mock import Mock
|
||||
|
||||
import huggingface_hub.constants
|
||||
import pytest
|
||||
@@ -9,6 +10,7 @@ from huggingface_hub.utils import LocalEntryNotFoundError
|
||||
|
||||
from vllm.model_executor.model_loader.weight_utils import (
|
||||
download_weights_from_hf,
|
||||
drop_checkpoint_cache,
|
||||
maybe_remap_kv_scale_name,
|
||||
)
|
||||
|
||||
@@ -292,5 +294,18 @@ class TestKvCacheScaleMapper:
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("fails", [False, True])
|
||||
def test_drop_checkpoint_cache_releases_local_weight_files(
|
||||
tmp_path, monkeypatch, fails
|
||||
):
|
||||
"""Evict only weights; cache eviction errors must not prevent loading."""
|
||||
for name in ("weights.safetensors", "config.json"):
|
||||
(tmp_path / name).touch()
|
||||
fadvise = Mock(side_effect=OSError("cache eviction failed") if fails else None)
|
||||
monkeypatch.setattr("os.posix_fadvise", fadvise)
|
||||
drop_checkpoint_cache(str(tmp_path))
|
||||
fadvise.assert_called_once()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_download_weights_from_hf()
|
||||
|
||||
Reference in New Issue
Block a user