Skip to content

vllm.multimodal.cache.shm

Implementation of Shared Memory Cache (see docs/configuration/optimization.md).

Classes:

ShmObjectStoreReceiverCache

Bases: BaseMultiModalReceiverCache

The cache which is used on P1 Worker Process when SHM caching is enabled.

How to update each item:

  • If the item has an address, replace the input with the cached item.
  • If not, return the input.

Methods:

touch_receiver_cache_item(mm_hash, mm_item=None)

Validate the item's handle in shared memory cache.

ShmObjectStoreSenderCache

Bases: BaseMultiModalProcessorCache

The cache which is used on P0 when SHM caching is enabled.

How to update each item:

  • If the item is already in the cache, clear the input to avoid unnecessary IPC.

  • If the item is not in the cache, store the data in shared memory.

Methods:

remove_dangling_items()

Remove items that are no longer in the shared memory cache.

touch_sender_cache_item(mm_hash)

Touch the item in shared memory cache to prevent eviction.