diff --git a/python/sglang/multimodal_gen/runtime/platforms/interface.py b/python/sglang/multimodal_gen/runtime/platforms/interface.py index 5f5c37ddb..e3e209793 100644 --- a/python/sglang/multimodal_gen/runtime/platforms/interface.py +++ b/python/sglang/multimodal_gen/runtime/platforms/interface.py @@ -343,6 +343,11 @@ class Platform: """Get the CPU architecture of the current platform.""" return CpuArchEnum.UNSPECIFIED + @classmethod + def enable_dit_layerwise_offload_for_wan_by_default(cls) -> bool: + """Whether to enable DIT layerwise offload by default on the current platform.""" + return True + def get_attn_backend(self, *args, **kwargs) -> AttentionImpl: attention_cls_str = self.get_attn_backend_cls_str(*args, **kwargs) return resolve_obj_by_qualname(attention_cls_str) diff --git a/python/sglang/multimodal_gen/runtime/platforms/rocm.py b/python/sglang/multimodal_gen/runtime/platforms/rocm.py index 5a2c5e844..24d1bd95a 100644 --- a/python/sglang/multimodal_gen/runtime/platforms/rocm.py +++ b/python/sglang/multimodal_gen/runtime/platforms/rocm.py @@ -165,3 +165,8 @@ class RocmPlatform(Platform): @classmethod def get_device_communicator_cls(cls) -> str: return "sglang.multimodal_gen.runtime.distributed.device_communicators.cuda_communicator.CudaCommunicator" # works for ROCm too + + @classmethod + def enable_dit_layerwise_offload_for_wan_by_default(cls) -> bool: + """ROCm performs better without DIT layerwise offload on Wan.""" + return False diff --git a/python/sglang/multimodal_gen/runtime/server_args.py b/python/sglang/multimodal_gen/runtime/server_args.py index d2fa12ff6..9363d4dd9 100644 --- a/python/sglang/multimodal_gen/runtime/server_args.py +++ b/python/sglang/multimodal_gen/runtime/server_args.py @@ -955,6 +955,7 @@ class ServerArgs: if ( "wan" in self.pipeline_config.__class__.__name__.lower() and self.dit_layerwise_offload is None + and current_platform.enable_dit_layerwise_offload_for_wan_by_default() ): logger.info( "Automatically enable dit_layerwise_offload for Wan for best performance"