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
11 changes: 6 additions & 5 deletions components/src/dynamo/sglang/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ support the current version plus 1 version back (N and N-1). The pattern:
enough surface area to cover what Dynamo actually calls.
4. Each fallback branch in `_compat.py` MUST have a comment noting which SGLang
version it supports and when it can be removed, e.g.:
`# Fallback for sglang <= 0.5.16. Remove when min supported version is 0.5.18+`
`# Fallback for sglang <= 0.5.17. Remove when min supported version is 0.5.19+`
Comment thread
jain-ria marked this conversation as resolved.
5. When a new SGLang version is released and the old N-1 falls outside the support
window, delete the corresponding fallback branches and polyfills from `_compat.py`.
If `_compat.py` becomes trivial re-exports, inline the imports and delete the file.
Expand Down Expand Up @@ -70,10 +70,11 @@ Worker dispatch (main.py:60-132):
have `max_running_requests`, `dllm_algorithm_config`, or other LLM-specific fields.
Use `getattr()` when accessing fields that may not exist on the stub.

SGLang 0.5.17 makes a resolved `ServerArgs` unconditionally read-only. Apply Dynamo's
post-resolution startup overrides through `_compat.override_server_args()`; control-plane
updates after engine creation should use the tokenizer manager's update API instead of
assigning fields on `server_args`.
SGLang 0.5.17 and 0.5.18 make a resolved `ServerArgs` unconditionally read-only.
Apply Dynamo's post-resolution, pre-publish startup updates through
`_compat.override_server_args()`; it selects 0.5.17's `override()` or 0.5.18's
`_late_resolution()` API. Control-plane updates after engine creation should use the
tokenizer manager's update API instead of assigning fields on `server_args`.

**DynamoConfig** combines `DynamoRuntimeConfig` (common flags like `--namespace`,
`--output-modalities`, `--media-output-fs-url`) with `DynamoSGLangConfig` (sglang-specific
Expand Down
23 changes: 14 additions & 9 deletions components/src/dynamo/sglang/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _warn_require_reasoning_unsupported() -> None:
def ensure_sglang_tensor_image_size() -> None:
"""Allow SGLang's image-token resolver to handle decoded image tensors.

SGLang 0.5.13 through 0.5.17 assume every decoded image exposes the PIL
SGLang 0.5.13 through 0.5.18 assume every decoded image exposes the PIL
``height``/``width`` attributes. Its CUDA JPEG decoder instead returns a
CHW tensor, causing multimodal requests to fall back to retokenization.

Expand Down Expand Up @@ -82,15 +82,20 @@ def resolve_image_token_counts(self: Any, images: list[Any]) -> list[int]:


def override_server_args(server_args: Any, source: str, **fields: Any) -> None:
"""Apply a post-resolution SGLang configuration update.

SGLang 0.5.17 makes ``ServerArgs`` unconditionally read-only after
resolution. Both supported CUDA releases expose ``ServerArgs.override`` as
the audited mutation API, so Dynamo must use it instead of assigning fields.
The separately pinned XPU image still uses SGLang 0.5.11, which predates
that API; preserve its legacy assignment behavior until its engine pin is
upgraded.
"""Apply a post-resolution, pre-publish SGLang configuration update.

SGLang 0.5.18 replaced ``ServerArgs.override`` with
``ServerArgs._late_resolution`` for launcher-stage updates that every holder
of the instance must observe. SGLang 0.5.17 exposes the former API. The
separately pinned XPU image still uses SGLang 0.5.11, which predates both;
preserve its legacy assignment behavior until its engine pin is upgraded.
"""
late_resolution = getattr(server_args, "_late_resolution", None)
if callable(late_resolution):
late_resolution(source, **fields)
return

# Fallback for SGLang 0.5.17. Remove when minimum supported SGLang is 0.5.18+.
override = getattr(server_args, "override", None)
if callable(override):
override(source, **fields)
Comment thread
jain-ria marked this conversation as resolved.
Expand Down
25 changes: 6 additions & 19 deletions components/src/dynamo/sglang/init_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from dynamo.common.utils.endpoint_types import parse_endpoint_types
from dynamo.llm import ModelInput, ModelType, WorkerType
from dynamo.runtime import DistributedRuntime
from dynamo.sglang._compat import override_server_args
from dynamo.sglang.args import Config
from dynamo.sglang.health_check import (
SglangDisaggHealthCheckPayload,
Expand Down Expand Up @@ -67,15 +66,9 @@ async def init_decode(
engine = snapshot_engine
load_time = 0.0
if getattr(server_args, "enable_forward_pass_metrics", False):
logging.warning(
"Forward pass metrics disabled in snapshot mode: the engine was "
"created before the endpoint existed, so its FPM publisher bound "
"a different IPC path than the relay would subscribe to."
)
override_server_args(
server_args,
"dynamo.snapshot",
enable_forward_pass_metrics=False,
raise RuntimeError(
"Snapshot ServerArgs must disable forward-pass metrics before "
"engine creation"
)
else:
set_forward_pass_metrics_worker_id(server_args, generate_endpoint)
Expand Down Expand Up @@ -227,15 +220,9 @@ async def init_prefill(
engine = snapshot_engine
load_time = 0.0
if getattr(server_args, "enable_forward_pass_metrics", False):
logging.warning(
"Forward pass metrics disabled in snapshot mode: the engine was "
"created before the endpoint existed, so its FPM publisher bound "
"a different IPC path than the relay would subscribe to."
)
override_server_args(
server_args,
"dynamo.snapshot",
enable_forward_pass_metrics=False,
raise RuntimeError(
"Snapshot ServerArgs must disable forward-pass metrics before "
"engine creation"
)
else:
set_forward_pass_metrics_worker_id(server_args, generate_endpoint)
Expand Down
8 changes: 7 additions & 1 deletion components/src/dynamo/sglang/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ async def prepare_snapshot_engine(
# Enable memory_saver so GPU memory can be released for CRIU.
# When using GMS, weights use VA-stable unmap/remap (no CPU backup); GMS
# forbids enable_weights_cpu_backup. Otherwise use CPU backup for weights.
snapshot_overrides = {"enable_memory_saver": True}
snapshot_overrides = {
"enable_memory_saver": True,
# Snapshot engines are created before the Dynamo endpoint exists, so
# their FPM publisher cannot be wired to the relay. Disable it before
# SGLang publishes ServerArgs; 0.5.18 forbids changing it afterwards.
"enable_forward_pass_metrics": False,
}
try:
from gpu_memory_service.integrations.sglang import is_gms_active

Expand Down
21 changes: 21 additions & 0 deletions components/src/dynamo/sglang/tests/test_sglang_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,27 @@ def test_diffusion_generator_kwargs_omits_unset_master_port():
assert "master_port" not in kwargs


def test_override_server_args_supports_sglang_0_5_17():
calls = []

class ServerArgs:
def override(self, source, **fields):
calls.append((source, fields))
for name, value in fields.items():
object.__setattr__(self, name, value)

server_args = ServerArgs()

override_server_args(
server_args,
"dynamo.test",
enable_memory_saver=True,
)

assert calls == [("dynamo.test", {"enable_memory_saver": True})]
assert server_args.enable_memory_saver is True


def test_override_server_args_supports_legacy_xpu_pin():
server_args = SimpleNamespace(enable_memory_saver=False)

Expand Down
4 changes: 2 additions & 2 deletions docs/fern/components/releases.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const CURRENT_TAG = "1.4.0";
export const CURRENT_WHEEL = "1.4.0";

export const MAIN_TOT: BackendPins = {
sglang: "0.5.17",
sglang: "0.5.18",
trtllm: "1.3.0rc24",
vllm: "0.27.1",
nixlSglang: "1.3.2",
Expand Down Expand Up @@ -1177,7 +1177,7 @@ export const FEATURE_INTERACTIONS: BackendInteractions[] = [
// KV Block Manager
[{ status: "wip" }, { status: "wip" }, { status: "wip" }, { status: "na" }],
// Multimodal
[{ status: "yes", label: "Supported serving patterns", note: "Supports aggregated EPD, E/PD, and E/P/D patterns. Traditional disaggregated EP/D is not supported.", source: "/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/sglang-multimodal" }, { status: "yes", label: "Image-aware routing on Dynamo's SGLang image", note: "Hash forwarding is upstream in SGLang 0.5.13+ and Dynamo pins 0.5.17, so the shipped image routes on image overlap. A custom build without that patch still serves the request but degrades to text-prefix routing.", source: "/dynamo/dev/multimodal/multimodal-kv-routing" }, { status: "na" }, { status: "wip" }, { status: "na" }],
[{ status: "yes", label: "Supported serving patterns", note: "Supports aggregated EPD, E/PD, and E/P/D patterns. Traditional disaggregated EP/D is not supported.", source: "/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/sglang-multimodal" }, { status: "yes", label: "Image-aware routing on Dynamo's SGLang image", note: "Hash forwarding is upstream in SGLang 0.5.13+ and Dynamo pins 0.5.18, so the shipped image routes on image overlap. A custom build without that patch still serves the request but degrades to text-prefix routing.", source: "/dynamo/dev/multimodal/multimodal-kv-routing" }, { status: "na" }, { status: "wip" }, { status: "na" }],
// Request Migration
[{ status: "yes" }, { status: "yes" }, { status: "yes" }, { status: "wip" }, { status: "yes" }, { status: "na" }],
// Request Cancellation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The launcher configures KV events on each worker and sets `--router-mode kv` wit
The Dynamo SGLang image includes both routing prerequisites:

- Dynamo is built with the `mm-routing` Rust feature.
- SGLang 0.5.13 or later includes `GenerateReqInput.mm_hashes` support. Dynamo currently pins 0.5.17.
- SGLang 0.5.13 or later includes `GenerateReqInput.mm_hashes` support. Dynamo currently pins 0.5.18.

Custom installations on SGLang 0.5.12 or earlier need the `mm_hashes` change
from [sgl-project/sglang#25300](https://github.com/sgl-project/sglang/pull/25300).
Expand Down
6 changes: 3 additions & 3 deletions docs/fern/pages/reference/general/compatibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Current stable release: v1.4.0 (container tag `1.4.0`, wheel version `1.4.0`).

| Dynamo | Type | SGLang | TensorRT-LLM | vLLM | NIXL (SGL / TRT / vLLM) | UCX |
| --- | --- | --- | --- | --- | --- | --- |
| main (ToT) | development head | 0.5.17 | 1.3.0rc24 | 0.27.1 | 1.3.2 / 1.3.1 / 1.3.2 | - |
| main (ToT) | development head | 0.5.18 | 1.3.0rc24 | 0.27.1 | 1.3.2 / 1.3.1 / 1.3.2 | - |
| v1.4.0 | stable | 0.5.16 | 1.3.0rc22 | 0.26.0 | 1.3.0 / 1.3.1 / 1.3.2 | 1.21.x |
| v1.3.1 | patch | 0.5.14 | 1.3.0rc19 | 0.23.0 | 1.3.2 / 1.0.1 / 1.1.0 | 1.20.x |
| v1.3.0 | stable | 0.5.14 | 1.3.0rc19 | 0.23.0 | 1.3.0 / 1.0.1 / 1.1.0 | 1.20.x |
Expand Down Expand Up @@ -306,10 +306,10 @@ Each cell states whether the row feature works together with the column feature.
| Feature | Disaggregated Serving | KV-Aware Routing | SLA-Based Planner | KV Block Manager | Multimodal | Request Migration | Request Cancellation | LoRA | Tool Calling | Speculative Decoding |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Disaggregated Serving | n/a | Yes | Yes | Experimental | Yes — Supports aggregated EPD, E/PD, and E/P/D patterns. Traditional disaggregated EP/D is not supported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/sglang-multimodal) | Yes | Experimental — Cancellation during remote prefill is not supported in disaggregated mode. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | Experimental — Code hooks exist, but examples and documentation are not yet available. |
| KV-Aware Routing | Yes | n/a | Yes | Experimental | Yes — Hash forwarding is upstream in SGLang 0.5.13+ and Dynamo pins 0.5.17, so the shipped image routes on image overlap. A custom build without that patch still serves the request but degrades to text-prefix routing. (https://docs.nvidia.com/dynamo/dev/multimodal/multimodal-kv-routing) | Yes | Yes | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | Experimental |
| KV-Aware Routing | Yes | n/a | Yes | Experimental | Yes — Hash forwarding is upstream in SGLang 0.5.13+ and Dynamo pins 0.5.18, so the shipped image routes on image overlap. A custom build without that patch still serves the request but degrades to text-prefix routing. (https://docs.nvidia.com/dynamo/dev/multimodal/multimodal-kv-routing) | Yes | Yes | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | Experimental |
| SLA-Based Planner | Yes | Yes | n/a | Experimental | n/a | Yes | Yes | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | n/a |
| KV Block Manager | Experimental | Experimental | Experimental | n/a | Experimental | Experimental | Experimental | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Experimental | Experimental |
| Multimodal | Yes — Supports aggregated EPD, E/PD, and E/P/D patterns. Traditional disaggregated EP/D is not supported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/sglang-multimodal) | Yes — Hash forwarding is upstream in SGLang 0.5.13+ and Dynamo pins 0.5.17, so the shipped image routes on image overlap. A custom build without that patch still serves the request but degrades to text-prefix routing. (https://docs.nvidia.com/dynamo/dev/multimodal/multimodal-kv-routing) | n/a | Experimental | n/a | Yes | Experimental | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | n/a |
| Multimodal | Yes — Supports aggregated EPD, E/PD, and E/P/D patterns. Traditional disaggregated EP/D is not supported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/sglang-multimodal) | Yes — Hash forwarding is upstream in SGLang 0.5.13+ and Dynamo pins 0.5.18, so the shipped image routes on image overlap. A custom build without that patch still serves the request but degrades to text-prefix routing. (https://docs.nvidia.com/dynamo/dev/multimodal/multimodal-kv-routing) | n/a | Experimental | n/a | Yes | Experimental | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | n/a |
| Request Migration | Yes | Yes | Yes | Experimental | Yes | n/a | Yes | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | Experimental |
| Request Cancellation | Experimental — Cancellation during remote prefill is not supported in disaggregated mode. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | Yes | Experimental | Experimental | Yes | n/a | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | Yes | n/a |
| LoRA | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | n/a | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) | No — SGLang does not support LoRA in Dynamo, so every LoRA pairing is unsupported. (https://docs.nvidia.com/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/overview) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Current stable release: v1.4.0 (Aug 14, 2026; container tag `1.4.0`, wheel versi

| Version | Kind | Date | SGLang | TensorRT-LLM | vLLM | NIXL (SGL / TRT / vLLM) | UCX | Notes | Delta |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| main (ToT) | development head | - | 0.5.17 | 1.3.0rc24 | 0.27.1 | 1.3.2 / 1.3.1 / 1.3.2 | - | - | - |
| main (ToT) | development head | - | 0.5.18 | 1.3.0rc24 | 0.27.1 | 1.3.2 / 1.3.1 / 1.3.2 | - | - | - |
| v1.4.0 | stable | Aug 14, 2026 | 0.5.16 | 1.3.0rc22 | 0.26.0 | 1.3.0 / 1.3.1 / 1.3.2 | 1.21.x | [release notes](https://docs.nvidia.com/dynamo/dev/reference/releases/v1-4-0) | Audit subsystem migrated into request trace (DYN_AUDIT_* honored as legacy aliases); HTTP header capture in trace records is an explicit fail-closed allowlist; deprecated multimodal worker flags and vLLM worker-role flags removed; runtime images no longer bundle software video decoders (H.264/H.265 decodes via NVDEC); UCX 1.21.x. |
| v1.3.1 | patch | Aug 5, 2026 | 0.5.14 | 1.3.0rc19 | 0.23.0 | 1.3.2 / 1.0.1 / 1.1.0 | 1.20.x | [release notes](https://docs.nvidia.com/dynamo/dev/reference/releases/v1-3-0#v131) | Patch release. Fixes disaggregated SGLang serving over AWS EFA on GB200: the SGLang EFA runtime moves to NIXL 1.3.2 and all three EFA images to EFA Installer 1.49.0. Backend pins are otherwise unchanged from v1.3.0. |
| v1.3.0 | stable | Jul 20, 2026 | 0.5.14 | 1.3.0rc19 | 0.23.0 | 1.3.0 / 1.0.1 / 1.1.0 | 1.20.x | [release notes](https://docs.nvidia.com/dynamo/dev/reference/releases/v1-3-0) | CUDA 12 container images discontinued; EFA variants retagged from -efa-amd64 to -efa (the images were already multi-arch — the old suffix was misleading); GA wheels published as 1.3.0.post1 (containers stay :1.3.0); UCX 1.20.x. |
Expand Down
Loading
Loading