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
revert os flag thing
  • Loading branch information
karen-sy committed Dec 4, 2025
commit 777ee1a86cf0cebdf834ba56b07ddeea9fae723a
14 changes: 0 additions & 14 deletions components/src/dynamo/frontend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ def parse_args():
default=float(os.environ.get("DYN_ROUTER_PRUNE_TARGET_RATIO", "0.8")),
help="KV Router: Target size ratio after pruning when KV events are disabled. Only used when --no-kv-events is set. Can be set via DYN_ROUTER_PRUNE_TARGET_RATIO env var (default: 0.8).",
)
parser.add_argument(
"--enable-local-kvindexers", # TODO (karen-sy) eventually will be equivalent to a "bypass Jetstream" option
action="store_true",
default=False,
help="KV Router: Enable worker-local kvindexers for worker-specific event storage (default disabled).",
)
parser.add_argument(
"--namespace",
type=str,
Expand Down Expand Up @@ -298,13 +292,6 @@ def signal_handler():

if flags.router_mode == "kv":
router_mode = RouterMode.KV

if flags.enable_local_kvindexers:
# set env var which propagates to worker-side publisher
os.environ["DYN_ENABLE_LOCAL_KVINDEXERS"] = "1"
else:
os.environ.pop("DYN_ENABLE_LOCAL_KVINDEXERS", None)

kv_router_config = KvRouterConfig(
overlap_score_weight=flags.kv_overlap_score_weight,
router_temperature=flags.router_temperature,
Expand All @@ -316,7 +303,6 @@ def signal_handler():
router_ttl_secs=flags.router_ttl,
router_max_tree_size=flags.router_max_tree_size,
router_prune_target_ratio=flags.router_prune_target_ratio,
enable_local_kvindexers=flags.enable_local_kvindexers,
)
elif flags.router_mode == "random":
router_mode = RouterMode.Random
Expand Down
17 changes: 1 addition & 16 deletions components/src/dynamo/router/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import argparse
import asyncio
import logging
import os
from typing import Optional

import uvloop
Expand Down Expand Up @@ -240,12 +239,6 @@ def parse_args():
help="KV Router: Target size ratio after pruning (0.0-1.0). Only used when --no-kv-events is set. Determines how aggressively to prune the tree (default: 0.8)",
)

parser.add_argument(
"--enable-local-kvindexers",
action="store_true",
default=False,
help="KV Router: Enable worker-local kvindexers for worker-specific event storage (default disabled).",
)
return parser.parse_args()


Expand All @@ -264,12 +257,6 @@ async def worker(runtime: DistributedRuntime):
)
namespace = endpoint_parts[0]

if args.enable_local_kvindexers:
# set env var which propagates to worker-side publisher
os.environ["DYN_ENABLE_LOCAL_KVINDEXERS"] = "1"
else:
os.environ.pop("DYN_ENABLE_LOCAL_KVINDEXERS", None)

logger.info("Starting Standalone Router Service")
logger.debug(
f"Configuration: endpoint={args.endpoint}, block_size={args.block_size}, "
Expand All @@ -281,8 +268,7 @@ async def worker(runtime: DistributedRuntime):
f"router_track_active_blocks={args.router_track_active_blocks}, "
f"router_ttl_secs={args.router_ttl_secs}, "
f"router_max_tree_size={args.router_max_tree_size}, "
f"router_prune_target_ratio={args.router_prune_target_ratio}, "
f"enable_local_kvindexers={args.enable_local_kvindexers}"
f"router_prune_target_ratio={args.router_prune_target_ratio}"
)

# Create KvRouter configuration
Expand All @@ -297,7 +283,6 @@ async def worker(runtime: DistributedRuntime):
router_ttl_secs=args.router_ttl_secs,
router_max_tree_size=args.router_max_tree_size,
router_prune_target_ratio=args.router_prune_target_ratio,
enable_local_kvindexers=args.enable_local_kvindexers,
)

# Create service component - use "router" as component name
Expand Down
1 change: 0 additions & 1 deletion launch/dynamo-run/src/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ impl Flags {
None,
None,
None,
None,
),
)
}
Expand Down
1 change: 0 additions & 1 deletion lib/bindings/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ pub unsafe extern "C" fn dynamo_create_worker_selection_pipeline(
None, // router_ttl_secs
None, // router_max_tree_size
None, // router_prune_target_ratio
None, // enable_local_kvindexers
))
} else {
None
Expand Down
4 changes: 1 addition & 3 deletions lib/bindings/python/rust/llm/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl KvRouterConfig {
#[pymethods]
impl KvRouterConfig {
#[new]
#[pyo3(signature = (overlap_score_weight=1.0, router_temperature=0.0, use_kv_events=true, router_replica_sync=false, router_track_active_blocks=true, router_snapshot_threshold=1000000, router_reset_states=false, router_ttl_secs=120.0, router_max_tree_size=1024, router_prune_target_ratio=0.8, enable_local_kvindexers=false))]
#[pyo3(signature = (overlap_score_weight=1.0, router_temperature=0.0, use_kv_events=true, router_replica_sync=false, router_track_active_blocks=true, router_snapshot_threshold=1000000, router_reset_states=false, router_ttl_secs=120.0, router_max_tree_size=1024, router_prune_target_ratio=0.8))]
#[allow(clippy::too_many_arguments)]
fn new(
overlap_score_weight: f64,
Expand All @@ -54,7 +54,6 @@ impl KvRouterConfig {
router_ttl_secs: f64,
router_max_tree_size: usize,
router_prune_target_ratio: f64,
enable_local_kvindexers: bool,
) -> Self {
KvRouterConfig {
inner: RsKvRouterConfig {
Expand All @@ -68,7 +67,6 @@ impl KvRouterConfig {
router_ttl_secs,
router_max_tree_size,
router_prune_target_ratio,
enable_local_kvindexers,
},
}
}
Expand Down
2 changes: 0 additions & 2 deletions lib/bindings/python/src/dynamo/_core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,6 @@ class KvRouterConfig:
router_ttl_secs: float = 120.0,
router_max_tree_size: int = 1024,
router_prune_target_ratio: float = 0.8,
enable_local_kvindexers: bool = False,
) -> None:
"""
Create a KV router configuration.
Expand All @@ -1052,7 +1051,6 @@ class KvRouterConfig:
router_ttl_secs: TTL for blocks in seconds when not using KV events (default: 120.0)
router_max_tree_size: Maximum tree size before pruning (default: 1024)
router_prune_target_ratio: Target size ratio after pruning (default: 0.8)
enable_local_kvindexers: Enable worker-local KV indexers for recovery queries (default: False)
"""
...

Expand Down
7 changes: 0 additions & 7 deletions lib/llm/src/kv_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ pub struct KvRouterConfig {

/// Target size ratio after pruning (only used when use_kv_events is false, default: 0.8)
pub router_prune_target_ratio: f64,

/// Whether to use worker-local kvindexers for worker-specific event storage
pub enable_local_kvindexers: bool,
}

impl Default for KvRouterConfig {
Expand All @@ -168,7 +165,6 @@ impl Default for KvRouterConfig {
router_ttl_secs: 120.0,
router_max_tree_size: 1024,
router_prune_target_ratio: 0.8,
enable_local_kvindexers: false,
}
}
}
Expand All @@ -188,7 +184,6 @@ impl KvRouterConfig {
router_ttl_secs: Option<f64>,
router_max_tree_size: Option<usize>,
router_prune_target_ratio: Option<f64>,
enable_local_kvindexers: Option<bool>,
) -> Self {
let default = Self::default();
Self {
Expand All @@ -205,8 +200,6 @@ impl KvRouterConfig {
router_max_tree_size: router_max_tree_size.unwrap_or(default.router_max_tree_size),
router_prune_target_ratio: router_prune_target_ratio
.unwrap_or(default.router_prune_target_ratio),
enable_local_kvindexers: enable_local_kvindexers
.unwrap_or(default.enable_local_kvindexers),
}
}
}
Expand Down
21 changes: 1 addition & 20 deletions lib/llm/src/kv_router/publisher.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

use std::env;
use std::fmt;
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::{Arc, OnceLock};
Expand Down Expand Up @@ -112,15 +111,7 @@ impl KvEventPublisher {
kv_block_size: u32,
source_config: Option<KvEventSourceConfig>,
) -> Result<Self> {
let enable_local_indexer = env::var("DYN_ENABLE_LOCAL_KVINDEXERS")
.map(|value| value == "1")
.unwrap_or(false);
Self::new_with_local_indexer(
component,
kv_block_size,
source_config,
enable_local_indexer,
)
Self::new_with_local_indexer(component, kv_block_size, source_config, true)
}

pub fn new_with_local_indexer(
Expand Down Expand Up @@ -2189,12 +2180,6 @@ mod test_integration_publisher {
#[tokio::test]
#[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<()> {
unsafe {
// Typical use case would set this env var via
// --enable-local-kvindexers flag in frontend or standalone router
env::set_var("DYN_ENABLE_LOCAL_KVINDEXERS", "1");
}

use crate::kv_router::scheduler::DefaultWorkerSelector;
use crate::kv_router::{
KvPushRouter, KvRouter, KvRouterConfig, worker_query::WorkerQueryClient,
Expand Down Expand Up @@ -2379,10 +2364,6 @@ mod test_integration_publisher {
for handle in server_handles {
handle.abort();
}
unsafe {
env::remove_var("DYN_ENABLE_LOCAL_KVINDEXERS");
}

distributed1.shutdown();
distributed2.shutdown();
router_distributed.shutdown();
Expand Down
Loading