Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions miles/ray/rollout.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from miles.utils.metric_utils import compute_pass_rate, compute_rollout_step, compute_statistics, dict_add_prefix
from miles.utils.misc import load_function
from miles.utils.ray_utils import Box
from miles.utils.rlix_validation import is_rlix_mode
from miles.utils.seqlen_balancing import get_seqlen_balanced_partitions
from miles.utils.tracking_utils import init_tracking
from miles.utils.types import Sample
Expand Down Expand Up @@ -1000,7 +1001,7 @@ def shrink_engines(
# because release_memory_occupation moves persistent
# token-pool buffers to CPU mid-iteration. The pause API
# blocks until the scheduler reaches a safe checkpoint.
if os.environ.get("RLIX_CONTROL_PLANE") == "rlix":
if is_rlix_mode():
# F7 (m11-review.review-report.md §2): documented SGLang
# /pause_generation API contract:
# - mode="retract" — waits until the SGLang scheduler reaches
Expand Down Expand Up @@ -1755,7 +1756,7 @@ def start_rollout_servers(args, pg) -> dict[str, RolloutServer]:
# actually return memory to the OS — which requires
# enable_memory_saver=True. Force it on under rlix when
# offload_rollout is set.
if args.offload_rollout and os.environ.get("RLIX_CONTROL_PLANE") == "rlix":
if args.offload_rollout and is_rlix_mode():
needs_offload = True
overrides = dict(group_cfg.overrides)
if args.offload_rollout and not needs_offload:
Expand Down
5 changes: 2 additions & 3 deletions miles/router/middleware_hub/radix_tree_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from miles.utils.http_utils import post
from miles.utils.mask_utils import get_response_lengths
from miles.utils.processing_utils import load_tokenizer
from miles.utils.rlix_validation import is_rlix_mode
from miles.utils.types import Sample

from .radix_tree import StringRadixTrie
Expand Down Expand Up @@ -64,9 +65,7 @@ def __init__(self, app, *, router):
# cache state would survive scheduler shrink/expand. Re-enabling
# under RLix mode requires a partial_rollout + radix_tree adapter
# (not in scope for any current milestone).
import os as _os # local import — module top imports must change

if _os.environ.get("RLIX_CONTROL_PLANE") == "rlix":
if is_rlix_mode():
raise RuntimeError(
"RadixTreeMiddleware is forbidden in RLix mode "
"(RLIX_CONTROL_PLANE=rlix). partial_rollout + radix_tree "
Expand Down