Repository navigation
[KV events] Publish opaque LoRA block IDs and adapter names - #42817
Merged
Merged
Conversation
sherlockwu
requested review from
ByronHsu,
Duyi-Wang,
HaiShaw,
Jialin,
ShangmingCai,
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
sogalin,
xiezhq-hermann and
yizhang2077
as code owners
October 6, 2026 21:55
KV events published LoRA blocks with the same hashes as base-model blocks, so cache-aware routers could not tell them apart. LoRA blocks now publish the event hash mixed with a seed of the adapter name, and BlockStored carries lora_name. The name is the only adapter id that is the same on every worker; the internal lora_id is a per-load uuid4. Base-model and salt-only events are unchanged. The mix is applied only when events are emitted; tree keys, storage hashes and LoRA scheduling are untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Append lora_name to the tokenized request structs: they are positional msgpack, and the Rust server encodes them by position. - Register only requests that resolved to an adapter; lora_path="" used to name the base namespace and namespace later base-model hashes. - Keep a name only while a request of its namespace is alive or its published blocks are not yet removed, so the table no longer grows with every extra_key and adapter reload. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Rust tree counts a block when its queued event is taken, so pruning from registration could drop a finished request's name while its store events were still queued, publishing them without the LoRA namespace. Prune only in take(), and register only where events are taken: publisher ranks with a prefix-sharing cache. Co-Authored-By: Claude Opus 5.5 <[email protected]>
sherlockwu
force-pushed
the
kan/lora-kv-events
branch
from
October 12, 2026 05:15
06f643f to
fcb0a64
Compare
ShangmingCai
approved these changes
Oct 12, 2026
ShangmingCai
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, let me process #42818
Collaborator
|
/tag-and-rerun-ci |
handle_generate_request and handle_embedding_request now call _record_kv_event_lora_name, which reads kv_events_publisher and recv_req.lora_name. Two tests drive these handlers on a Scheduler built with object.__new__, so base-a-test-cpu failed with AttributeError. Stub the hook next to the _maybe_namespace_elastic_radix_cache stub they already set, and add lora_name to the TokenizedEmbeddingReqInput fake. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Commit 1a2ac97 formatted the evict_device_leaf assert in black's style; the pinned ruff-format (v0.15.1) wants the message in parentheses instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r fake Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
|
/tag-and-rerun-ci |
Collaborator
|
/rerun-failed-ci |
5 tasks
jain-ria
added a commit
to jain-ria/sglang
that referenced
this pull request
Oct 15, 2026
Two unit tests construct their objects with `__new__` and set only the attributes they need. Recent main changes read attributes the real constructors always set but the fakes lacked: - sgl-project#44326 made `PrefillCudaGraphRunner.can_run_graph` read `max_seq_len`; `test_cp_strategy_unit.py`'s runner did not set it. - sgl-project#42817 made generate-request handling read `kv_events_publisher`; `test_request_class_override_points.py`'s fake scheduler (sgl-project#44113) lacked it. Both failed with AttributeError on main and on every PR running the CPU suite. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: jain-ria <[email protected]>
nvpohanh
added a commit
to weireweire/sglang
that referenced
this pull request
Oct 15, 2026
Resolve the build_fixture signature conflict in test_unified_radix_cache_unittest.py by keeping both the PR's swa_max_states_per_path and main's kv_event_lora_names (sgl-project#42817). Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LoRA blocks need a public adapter name for prompt lookup and an opaque block ID for stores, parent links, and removals. This adds LoRA support to the default KV-event mode while preserving existing base-model and salt-only events.
Changes
BlockStored.lora_namefor admitted LoRA requests in both existing event modes. The optional name is appended to the tokenized IPC structs; older senders can omit it and resolve the name from the admitted adapter ID.extra_key, including the adapter load's UUID. Two loads of the same public adapter name retain different external IDs. Use the same mix for stored blocks, parent links, and removals.lora_name, andcache_salt; external IDs do not need to be reproducible from a request.lora_namefields. Tree keys, HiCache storage keys, model execution, and LoRA loading/scheduling are unchanged.(adapter load, extra_key)namespace.extra_keyboundaries and the Python adapter applies the default mix.The router follow-up is #42818, which separates external IDs from canonical prompt lookup keys.
Validation
Python checks ran on macOS with the production native hash C++ source compiled against the system SHA-256 provider. The Linux-only extension loader was replaced with that compiled module for the checks. Python/Rust binding integration, CUDA HiCache transitions, and serving E2E were not rerun: the GPU devbox was evicted for low ephemeral storage.
Limit
Reloading different weights under the same public adapter name can still credit old blocks until eviction, as in Dynamo/vLLM. Distinct external IDs prevent removals of one load from revoking another; versioned public names are needed to distinguish weights in request lookup.
CI States
Latest PR Test (Base): ❌ Run #38239470723
Latest PR Test (Extra): ❌ Run #38239470805
Latest PR Test (AMD ROCm 10): ❌ Run #38239470773