Skip to content

vllm.v1.kv_offload.file_mapper

Classes:

  • FileMapper –

    FileMapper maps KV blocks (given by their hash) to file names.

FileMapper

FileMapper maps KV blocks (given by their hash) to file names.

Methods:

__init__(root_dir, model_name, tokens_per_hash, blocks_per_file, tp_size, pp_size, pcp_size, dcp_size, rank, dtype, kv_cache_groups=None, inference_engine='vllm', parallel_agnostic=False, replicated_layout=False, canonical_format=None)

Initialize the file mapper. Each worker constructs its own, but config.json is shared across workers since rank lives outside the hash. When parallel_agnostic=True, tp/pp/pcp/dcp are forced to 1 and rank to 0 so multiple parallelism layouts collapse into the same folder.

_compute_base_path(root_dir, fields) staticmethod

Layout: //. safe_model_name replaces '/' with '' so HuggingFace IDs don't nest.

from_offloading_spec(root_dir, offloading_spec, blocks_per_file=1, parallel_agnostic=False) classmethod

Build a FileMapper from an OffloadingSpec.

get_file_name(key)

Map an OffloadKey to _r//_g/.bin.