Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a242346
checkpt before branch switch
karen-sy Nov 13, 2025
1771f85
checkpt before buffers
karen-sy Nov 20, 2025
a415a1a
checkpoint before testing localkvindexer
karen-sy Nov 20, 2025
6adda0d
undo accidental toml change
karen-sy Nov 21, 2025
ad485f0
fix Arc patterns, patch unit test races
karen-sy Nov 24, 2025
76a2088
Merge remote-tracking branch 'origin/main' into karenc/distributed_bl…
karen-sy Nov 24, 2025
54eca97
format + fix clippy warnings
karen-sy Nov 24, 2025
6e58c2d
checkpoint before branch switch
karen-sy Nov 25, 2025
2608be0
draft of components with hacky raw nats client
karen-sy Nov 26, 2025
43855ae
small comments
karen-sy Nov 26, 2025
b35781a
up
karen-sy Nov 26, 2025
4227941
merge main
karen-sy Dec 1, 2025
eaf72b8
integration tests with mock workers
karen-sy Dec 2, 2025
c077d36
docstrings, formatting
karen-sy Dec 2, 2025
42a5a3e
helpers for indexing into buffers
karen-sy Dec 2, 2025
02ed5b9
Merge remote-tracking branch 'origin' into karenc/distributed_blocks
karen-sy Dec 2, 2025
e439489
merge main for ci fix
karen-sy Dec 2, 2025
44628af
Merge remote-tracking branch 'origin' into karenc/distributed_blocks
karen-sy Dec 2, 2025
ded0b08
move shared DRT creator to distributed.rs
karen-sy Dec 2, 2025
6ee2921
expose publisher feature via frontend/router flag which sets env var
karen-sy Dec 3, 2025
05bd78b
Merge remote-tracking branch 'origin' into karenc/distributed_blocks
karen-sy Dec 3, 2025
e806343
Merge remote-tracking branch 'origin' into karenc/distributed_blocks
karen-sy Dec 3, 2025
777ee1a
revert os flag thing
karen-sy Dec 4, 2025
df28d3f
mdc registration for enable localkvindexer + related workerqueryclien…
karen-sy Dec 5, 2025
54c2efb
nit
karen-sy Dec 5, 2025
b23a84a
fix nits
karen-sy Dec 5, 2025
fe3b56a
use routerevents, move test
karen-sy Dec 5, 2025
0dad7c5
merge main
karen-sy Dec 5, 2025
37fee4b
up
karen-sy Dec 5, 2025
43ebf91
oops didnt include args.py diff
karen-sy Dec 5, 2025
3b60d0f
nit
karen-sy Dec 8, 2025
4b00804
quick checkpoint before switching branches
karen-sy Dec 9, 2025
cb7568c
ranged workerevent query
karen-sy Dec 10, 2025
c76c74a
recovery for startup and gaps
karen-sy Dec 11, 2025
6a5b2dd
Merge remote-tracking branch 'origin/main' into karenc/mdc_from_frontend
karen-sy Dec 11, 2025
69135ad
add back integration guard
karen-sy Dec 11, 2025
f2be88e
clippy
karen-sy Dec 11, 2025
3fda0f3
Merge branch 'main' of github.com:ai-dynamo/dynamo into karenc/distri…
karen-sy Dec 11, 2025
582d836
Merge branch 'karenc/mdc_from_frontend' into karenc/distributed_blocks
karen-sy Dec 11, 2025
6b5eeb1
clone mdc rx, os env args, test header
karen-sy Dec 11, 2025
afb519c
Merge branch 'main' into karenc/distributed_blocks
PeaBrane Dec 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clone mdc rx, os env args, test header
  • Loading branch information
karen-sy committed Dec 11, 2025
commit 6b5eeb1ccdbd45080137f9e1cecc0d74cf235f12
7 changes: 5 additions & 2 deletions components/src/dynamo/vllm/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ def parse_args() -> Config:
)
parser.add_argument(
"--enable-local-indexer",
action="store_true",
help="Enable worker-local KV indexer for tracking this worker's own KV cache state.",
type=str,
choices=["true", "false"],
default=os.environ.get("DYN_LOCAL_INDEXER", "false"),
help="Enable worker-local KV indexer for tracking this worker's own KV cache state (can also be toggled with env var DYN_LOCAL_INDEXER).",
)
parser.add_argument(
"--use-vllm-tokenizer",
Expand All @@ -220,6 +222,7 @@ def parse_args() -> Config:

parser = AsyncEngineArgs.add_cli_args(parser)
args = parser.parse_args()
args.enable_local_indexer = str(args.enable_local_indexer).lower() == "true"
engine_args = AsyncEngineArgs.from_cli_args(args)

# Workaround for vLLM GIL contention bug with NIXL connector when using UniProcExecutor.
Expand Down
14 changes: 2 additions & 12 deletions lib/llm/src/kv_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,6 @@ impl KvRouter {
card.runtime_config
});

// Watch for local indexer states via discovery interface (separate stream needed
// because streams are consumed by watch_and_extract_field)
let discovery_stream_local_indexer = discovery
.list_and_watch(discovery_key, Some(cancellation_token.clone()))
.await?;
let local_indexer_rx = watch_and_extract_field(
discovery_stream_local_indexer,
|card: ModelDeploymentCard| card.runtime_config.enable_local_indexer,
);

let indexer = if kv_router_config.overlap_score_weight == 0.0 {
// When overlap_score_weight is zero, we don't need to track prefixes
Indexer::None
Expand Down Expand Up @@ -353,7 +343,7 @@ impl KvRouter {
component.clone(),
block_size,
instance_ids_rx,
runtime_configs_rx,
runtime_configs_rx.clone(),
selector,
kv_router_config.router_replica_sync,
consumer_id.clone(),
Expand All @@ -363,7 +353,7 @@ impl KvRouter {
// Initialize worker query client using namespace abstraction
// (created before background task so we can use it for startup recovery)
let worker_query_client =
worker_query::WorkerQueryClient::new(component.clone(), local_indexer_rx);
worker_query::WorkerQueryClient::new(component.clone(), runtime_configs_rx.clone());
tracing::info!("Worker query client initialized");

// Start KV event subscriber background process (only when use_kv_events is enabled)
Expand Down
4 changes: 2 additions & 2 deletions lib/llm/src/kv_router/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,7 @@ mod test_integration_publisher_with_kvindexer {
use dynamo_runtime::protocols::annotated::Annotated;

/// Integration test: KvPushRouter end-to-end routing with mock engines.
#[tokio::test]
#[tokio::test(flavor = "multi_thread")]
#[ignore] // Requires NATS/etcd. Run with: cargo test --package dynamo-llm --lib --features integration test_distributed_kvindexer_e2e -- --ignored --nocapture
async fn test_distributed_kvindexer_e2e() -> anyhow::Result<()> {
const BLOCK_SIZE: u32 = 4;
Expand Down Expand Up @@ -2339,7 +2339,7 @@ mod test_integration_publisher_with_kvindexer {
Ok(())
}

#[tokio::test]
#[tokio::test(flavor = "multi_thread")]
#[ignore]
async fn test_distributed_kvindexer_e2e_startup() -> anyhow::Result<()> {
const BLOCK_SIZE: u32 = 4;
Expand Down
11 changes: 6 additions & 5 deletions lib/llm/src/kv_router/worker_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use tokio::sync::watch;
use crate::kv_router::WORKER_KV_INDEXER_QUERY_SUBJECT;
use crate::kv_router::indexer::{WorkerKvQueryRequest, WorkerKvQueryResponse};
use crate::kv_router::protocols::WorkerId;
use crate::local_model::runtime_config::ModelRuntimeConfig;

/// Router-side client for querying worker local KV indexers
///
Expand All @@ -21,27 +22,27 @@ use crate::kv_router::protocols::WorkerId;
pub struct WorkerQueryClient {
component: Component,
/// Watch receiver for enable_local_indexer state per worker
local_indexer_rx: watch::Receiver<HashMap<WorkerId, bool>>,
model_runtime_config_rx: watch::Receiver<HashMap<WorkerId, ModelRuntimeConfig>>,
}

impl WorkerQueryClient {
/// Create a new WorkerQueryClient with a watch receiver for local indexer states
pub fn new(
component: Component,
local_indexer_rx: watch::Receiver<HashMap<WorkerId, bool>>,
model_runtime_config_rx: watch::Receiver<HashMap<WorkerId, ModelRuntimeConfig>>,
) -> Self {
Self {
component,
local_indexer_rx,
model_runtime_config_rx,
}
}

/// Check if a worker has local indexer enabled
pub fn has_local_indexer(&self, worker_id: WorkerId) -> bool {
self.local_indexer_rx
self.model_runtime_config_rx
.borrow()
.get(&worker_id)
.copied()
.map(|config| config.enable_local_indexer)
.unwrap_or(false)
}

Expand Down
Loading