From 6e9e773188d1dc5eb699e583ac5b78a6937a9d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=20=D0=A1=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=D0=BD?= <58187114+OrangeRedeng@users.noreply.github.com> Date: Thu, 5 Mar 2026 18:50:08 +0300 Subject: [PATCH 1/5] Update cache_dit_integration.py --- .../multimodal_gen/runtime/cache/cache_dit_integration.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py index e0812488188b..18b238e8e6e3 100644 --- a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py +++ b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py @@ -13,6 +13,7 @@ import torch.distributed as dist from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger +from sglang.multimodal_gen.runtime.distributed.parallel_state import get_sp_group logger = init_logger(__name__) @@ -107,15 +108,15 @@ def _build_parallelism_config( ulysses_size = None ring_size = None if sp_group is not None: - ulysses_size = getattr(sp_group, "ulysses_world_size", None) - ring_size = getattr(sp_group, "ring_world_size", None) + ulysses_size = get_sp_group().ulysses_world_size + ring_size = get_sp_group().ring_world_size tp_size = None if tp_group is not None: tp_size = dist.get_world_size(tp_group) return ParallelismConfig( - backend=ParallelismBackend.NATIVE_PYTORCH, + backend=ParallelismBackend.AUTO, ulysses_size=ulysses_size, ring_size=ring_size, tp_size=tp_size, From 18da1747c1ba6c3f2cd0e3201fcb57ccc3f49097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=20=D0=A1=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=D0=BD?= <58187114+OrangeRedeng@users.noreply.github.com> Date: Thu, 5 Mar 2026 19:06:03 +0300 Subject: [PATCH 2/5] Fix lint issue --- .../multimodal_gen/runtime/cache/cache_dit_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py index 18b238e8e6e3..bbafc5c9aa6d 100644 --- a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py +++ b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py @@ -12,8 +12,8 @@ import torch import torch.distributed as dist -from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger from sglang.multimodal_gen.runtime.distributed.parallel_state import get_sp_group +from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger logger = init_logger(__name__) From 78f194062056b625128a8b7a6d43be6b82b3ac08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=20=D0=A1=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=D0=BD?= <58187114+OrangeRedeng@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:07:17 +0300 Subject: [PATCH 3/5] Switch to built-in functions --- .../runtime/cache/cache_dit_integration.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py index bbafc5c9aa6d..59cf97800fc2 100644 --- a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py +++ b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py @@ -12,7 +12,12 @@ import torch import torch.distributed as dist -from sglang.multimodal_gen.runtime.distributed.parallel_state import get_sp_group +from sglang.multimodal_gen.runtime.distributed.parallel_state import ( + get_sp_group, + get_tp_world_size, + get_ring_parallel_world_size, + get_ulysses_parallel_world_size, +) from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger logger = init_logger(__name__) @@ -108,12 +113,12 @@ def _build_parallelism_config( ulysses_size = None ring_size = None if sp_group is not None: - ulysses_size = get_sp_group().ulysses_world_size - ring_size = get_sp_group().ring_world_size + ulysses_size = get_ulysses_parallel_world_size() + ring_size = get_ring_parallel_world_size() tp_size = None if tp_group is not None: - tp_size = dist.get_world_size(tp_group) + tp_size = get_tp_world_size() return ParallelismConfig( backend=ParallelismBackend.AUTO, From 6f0d25adeaf54de82e9da89386e668ae6d906a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=20=D0=A1=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=D0=BD?= <58187114+OrangeRedeng@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:07:54 +0300 Subject: [PATCH 4/5] Update cache_dit_integration.py --- .../sglang/multimodal_gen/runtime/cache/cache_dit_integration.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py index 59cf97800fc2..694c2ddc7635 100644 --- a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py +++ b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py @@ -13,7 +13,6 @@ import torch.distributed as dist from sglang.multimodal_gen.runtime.distributed.parallel_state import ( - get_sp_group, get_tp_world_size, get_ring_parallel_world_size, get_ulysses_parallel_world_size, From fab79fd55e176f67b239d14fe3e2b283b4e471b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=20=D0=A1=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=D0=BD?= <58187114+OrangeRedeng@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:40:38 +0300 Subject: [PATCH 5/5] Update cache_dit_integration.py --- .../multimodal_gen/runtime/cache/cache_dit_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py index 694c2ddc7635..bf0172e6d812 100644 --- a/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py +++ b/python/sglang/multimodal_gen/runtime/cache/cache_dit_integration.py @@ -13,8 +13,8 @@ import torch.distributed as dist from sglang.multimodal_gen.runtime.distributed.parallel_state import ( - get_tp_world_size, get_ring_parallel_world_size, + get_tp_world_size, get_ulysses_parallel_world_size, ) from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger