vllm.distributed.kv_transfer.kv_connector.v1.umbp.data
¶
Shared data types for the UMBP KV connector.
The types in this module deliberately do not depend on a UMBP client. They describe vLLM's logical KV objects and the physical ranges a runtime adapter will transfer.
Classes:
-
BlockIdentityCodec–Build stable rank-local keys from vLLM block hashes.
-
BlockLoadBatch–Whole-block loads with request metadata shared across the batch.
-
BlockStoreBatch–Columnar whole-block stores with request metadata shared by the batch.
-
BlockTransferPlan–One complete logical block transfer.
-
KVLayoutDescriptor–Backend-neutral description of one rank-local KV object layout.
-
KVLayoutPlanner–Create a deterministic all-layer object layout from KVCacheConfig.
-
KVRange–A source/destination range in a runtime transfer.
-
KVRegion–One deterministic region in a rank-local KV object.
-
LoadSpec–Scheduler decision for one externally loaded prefix.
-
RankTopology–Model-parallel ranks that participate in one KV object.
-
RequestTracker–Core request state shared by every runtime mode.
-
StoreEventResult–Number of workers that finished one store event.
-
TransferJobState–Per-key completion state; one failed key does not fail its siblings.
-
UMBPConnectorMetadata–Scheduler-to-worker metadata for one engine step.
-
UMBPConnectorWorkerMetadata–Worker completion metadata aggregated across ranks.
-
UMBPHandshakeMetadata–Namespace a worker derived, reported to the scheduler at startup.
-
UMBPNamespace–Compatibility namespace for objects stored outside the engine.
Functions:
-
tp_replicated_group_ids–Groups whose blocks are byte-identical on every TP rank.
BlockIdentityCodec
dataclass
¶
Build stable rank-local keys from vLLM block hashes.
Groups in replicated_groups get one TP-agnostic key (tp*) that
every TP rank loads and only TP rank 0 stores.
Methods:
-
keys_per_object–Number of rank keys that together hold one logical block.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
keys_per_object(topology, group_id)
¶
Number of rank keys that together hold one logical block.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
BlockLoadBatch
dataclass
¶
Bases: Sequence[BlockTransferPlan]
Whole-block loads with request metadata shared across the batch.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
BlockStoreBatch
dataclass
¶
Bases: Sequence[BlockTransferPlan]
Columnar whole-block stores with request metadata shared by the batch.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
BlockTransferPlan
dataclass
¶
One complete logical block transfer.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
KVLayoutDescriptor
dataclass
¶
Backend-neutral description of one rank-local KV object layout.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
KVLayoutPlanner
¶
Create a deterministic all-layer object layout from KVCacheConfig.
Methods:
-
plan_for_block–Lower one GPU block into a deterministic scatter/gather plan.
-
register_kv_caches–Capture stable base addresses for the planned KV regions.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 | |
plan_for_block(key, block_id, base_addresses, *, group_id=None, request_id=None)
¶
Lower one GPU block into a deterministic scatter/gather plan.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
register_kv_caches(kv_caches)
¶
Capture stable base addresses for the planned KV regions.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
KVRange
¶
Bases: NamedTuple
A source/destination range in a runtime transfer.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
KVRegion
dataclass
¶
One deterministic region in a rank-local KV object.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
LoadSpec
dataclass
¶
Scheduler decision for one externally loaded prefix.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
RankTopology
dataclass
¶
Model-parallel ranks that participate in one KV object.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
RequestTracker
dataclass
¶
Core request state shared by every runtime mode.
Methods:
-
mark_saved–Advance the save watermark only to a complete block boundary.
-
replace_blocks–Replace stale pre-preemption tables with resumed full tables.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
mark_saved(token_count, block_size)
¶
Advance the save watermark only to a complete block boundary.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
replace_blocks(block_ids)
¶
Replace stale pre-preemption tables with resumed full tables.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
StoreEventResult
dataclass
¶
Number of workers that finished one store event.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
TransferJobState
dataclass
¶
Per-key completion state; one failed key does not fail its siblings.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
UMBPConnectorMetadata
dataclass
¶
Bases: KVConnectorMetadata
Scheduler-to-worker metadata for one engine step.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
UMBPConnectorWorkerMetadata
dataclass
¶
Bases: KVConnectorWorkerMetadata
Worker completion metadata aggregated across ranks.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
UMBPHandshakeMetadata
dataclass
¶
Bases: KVConnectorHandshakeMetadata
Namespace a worker derived, reported to the scheduler at startup.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
UMBPNamespace
dataclass
¶
Compatibility namespace for objects stored outside the engine.
Methods:
-
configured–Return the explicit
key_namespace, or None when it is derived. -
from_vllm_config–Derive the namespace from a worker's per-layer KV cache config.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
configured(vllm_config)
classmethod
¶
Return the explicit key_namespace, or None when it is derived.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
from_vllm_config(vllm_config, kv_cache_config)
classmethod
¶
Derive the namespace from a worker's per-layer KV cache config.
The scheduler's config flattens UniformTypeKVCacheSpecs groups, so the scheduler adopts the namespace its workers report instead.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
_engine_may_load_foreign_kv(vllm_config)
¶
Whether any connector of this engine may load KV that vLLM's own cache writer did not produce, e.g. a MultiConnector sibling of UMBP.
MultiConnector hands each child a config copy holding only that child's kv_transfer_config, so read the engine's current config, which workers set while they create their connector.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
_layer_specs(group)
¶
Map each layer of a cache group to the spec describing its own pages.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
_model_fingerprint(model_config)
¶
Effective model settings that change the KV a checkpoint produces.
hf_config already has hf_overrides applied, so overridden RoPE or
attention settings separate engines that share the same model path.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
_page_segments(spec, tensor, num_blocks, layout)
¶
Byte (offset, length) runs of a layer's page from its block start.
Empty when the page is one contiguous run. LHBNC and BHLNC store each head's tokens as a separate run.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
_spec_fingerprint(spec)
¶
Every field that shapes a layer's stored bytes, in a stable form.
Source code in vllm/distributed/kv_transfer/kv_connector/v1/umbp/data.py
tp_replicated_group_ids(config, topology)
¶
Groups whose blocks are byte-identical on every TP rank.
Every layer must declare a single TP shard (max_tp_shards=1, e.g. MLA
latents and sparse indexers); context parallelism shards them, so it opts
out.