[diffusion] chore: remove default post-denoising dit offload in local mode (#15573)
This commit is contained in:
@@ -754,20 +754,6 @@ class DenoisingStage(PipelineStage):
|
|||||||
torch.mps.current_allocated_memory(),
|
torch.mps.current_allocated_memory(),
|
||||||
)
|
)
|
||||||
|
|
||||||
# In offline local mode (`sglang generate`), offload transformer weights to CPU
|
|
||||||
# after denoising to reduce peak VRAM during VAE decoding.
|
|
||||||
if current_platform.is_cuda_alike() and server_args.is_local_mode:
|
|
||||||
for model in (self.transformer, self.transformer_2):
|
|
||||||
if model is not None:
|
|
||||||
model.to("cpu")
|
|
||||||
logger.info(
|
|
||||||
"Offloaded denoiser transformer weights to CPU after denoising to reduce peak VRAM during VAE decoding."
|
|
||||||
)
|
|
||||||
try:
|
|
||||||
torch.cuda.empty_cache()
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _preprocess_sp_latents(self, batch: Req, server_args: ServerArgs):
|
def _preprocess_sp_latents(self, batch: Req, server_args: ServerArgs):
|
||||||
"""Shard latents for Sequence Parallelism if applicable."""
|
"""Shard latents for Sequence Parallelism if applicable."""
|
||||||
if get_sp_world_size() <= 1:
|
if get_sp_world_size() <= 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user