Skip to content

vllm.model_executor.model_loader.weight_cache.weight_seed.utils

Helpers for weight shard seeding (manifest format, fingerprint, launcher logic).

Classes:

Functions:

  • allocate_storage –

    A fresh byte buffer for one manifest storage, on the source's device type.

  • build_manifest –

    Describe tensors as views over their unique storages.

  • mirror_device_indices –

    A same-host mirror's GPU indices: the free ones past the source's.

  • rebuild_tensors –

    Recreate every manifest tensor on the mirror's copies; bounds-checked first.

  • seed_address –

    Resolve one daemon's rank-matched source socket or remote endpoint.

  • seed_mismatches –

    Fields on which a seed source's shard differs (model-path fallback).

  • validate_weights_payload –

    Structural checks plus the shard fingerprint against the expected key.

WeightsSeedPayload

Bases: TypedDict

What a source daemon's weights resolve sends to a peer loader.

Attributes:

cache_config instance-attribute

asdict(WeightCacheKey) of the source's shard.

manifest instance-attribute

Storage manifest, as build_manifest produces.

seed instance-attribute

Mover-specific transfer seed; seed["backend"] picks the mover.

_view_extent(view, itemsize)

Bytes from the start of its storage that a strided view reaches.

allocate_storage(storage, device)

A fresh byte buffer for one manifest storage, on the source's device type.

build_manifest(tensors, kinds)

Describe tensors as views over their unique storages.

mirror_device_indices(addresses, num_local)

A same-host mirror's GPU indices: the free ones past the source's.

rebuild_tensors(manifest, buffers)

Recreate every manifest tensor on the mirror's copies; bounds-checked first.

seed_address(addresses, local_rank, global_rank, port_offset=0, *, node_rank=0, is_draft=False)

Resolve one daemon's rank-matched source socket or remote endpoint.

seed_mismatches(local, source, model, source_model)

Fields on which a seed source's shard differs (model-path fallback).

validate_weights_payload(payload, expected_key, model)

Structural checks plus the shard fingerprint against the expected key.