vllm.v1.kv_offload.tiering.example.manager ¶
ExampleSecondaryTierManager: A simple in-memory secondary tier.
This implementation provides a minimal secondary tier that stores blocks in memory (using a dictionary) with immediate completion. It serves as a reference for writing new tiers and is useful for testing the TieringOffloadingManager without requiring actual storage or network backends.
ExampleSecondaryTierManager ¶
Bases: SecondaryTierManager
A simple in-memory secondary tier.
This implementation: - Stores blocks in a dictionary (key -> True) - Completes transfers immediately (synchronous)
Source code in vllm/v1/kv_offload/tiering/example/manager.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
__init__ ¶
__init__(
offloading_spec: OffloadingSpec,
primary_kv_view: memoryview,
tier_type: str,
custom_param: int = 0,
)
Initialize the example secondary tier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
custom_param | int | Dummy parameter demonstrating custom args. | 0 |
Source code in vllm/v1/kv_offload/tiering/example/manager.py
get_finished_jobs ¶
lookup ¶
lookup(
key: OffloadKey, req_context: ReqContext
) -> bool | None
Check whether a block exists in this secondary tier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key | OffloadKey | Offload key to look up. | required |
req_context | ReqContext | Per-request context. | required |
Returns:
| Type | Description |
|---|---|
bool | None | True if the block is present, False if not found. |
Source code in vllm/v1/kv_offload/tiering/example/manager.py
submit_load ¶
submit_load(job_metadata: JobMetadata) -> None
Submit a job to load blocks from this tier to primary tier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_metadata | JobMetadata | Job metadata including job_id, keys, and spec for writing blocks into the primary tier. | required |
Source code in vllm/v1/kv_offload/tiering/example/manager.py
submit_store ¶
submit_store(job_metadata: JobMetadata) -> None
Submit a job to store blocks from primary tier to this tier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_metadata | JobMetadata | Job metadata including job_id, keys, and spec for reading blocks from the primary tier. | required |