Skip to content
Draft
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: 5 additions & 0 deletions python/sglang/srt/disaggregation/nixl/conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@ def __init__(
sync_mode=nixl_thread_sync_t.NIXL_THREAD_SYNC_STRICT,
)
self.agent = nixl_agent(str(uuid.uuid4()), agent_config)
if envs.SGLANG_DISAGGREGATION_NIXL_USE_TORCH_TRANSFER.get():
from nixl.torch_transfer import TorchTransferAgent

# The manager's allocation lifetime contract remains unchanged.
self.agent = TorchTransferAgent(self.agent, owner=self)
if num_threads > 0:
# TODO: Remove this once NIXL passes thread parameters from
# nixl_agent_config to explicitly-created backends.
Expand Down
13 changes: 13 additions & 0 deletions python/sglang/srt/disaggregation/nixl/torch_transfer_mvp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Core transfer experiment

Set `SGLANG_DISAGGREGATION_NIXL_USE_TORCH_TRANSFER=1` on test workers. Requires
the PyTorch `_transfer` prototype and NIXL `torch_transfer` provider. Default: off.

The NIXL agent is wrapped after creation, retaining its configured backends and
strict thread synchronization. Registration, prepared indexed WRITE, fallback
transfers and notifications route through Core. Bootstrap, allocation ownership,
CUDA ordering, staging and abort protocols are unchanged.

This is a **success-path review prototype**, not a production mode. The manager
must keep raw-pointer allocations stable. Active cancellation and failure recovery
are outside the MVP. GPU serving/staging and throughput remain unvalidated.
1 change: 1 addition & 0 deletions python/sglang/srt/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ class Envs:
# A wedged RDMA stack fails startup here instead of at the scheduler watchdog.
SGLANG_DISAGGREGATION_ENGINE_INIT_TIMEOUT = EnvInt(60)
SGLANG_DISAGGREGATION_NIXL_BACKEND = EnvStr("UCX")
SGLANG_DISAGGREGATION_NIXL_USE_TORCH_TRANSFER = EnvBool(False)
SGLANG_DISAGGREGATION_NIXL_BACKEND_PARAMS = EnvStr("{}")
SGLANG_DISAGG_PREFILL_EARLY_SEND_CACHED_PREFIX = EnvBool(True)
SGLANG_DISAGGREGATION_ZMQ_MAX_SOCKETS = EnvInt(16384)
Expand Down
Loading