[Diffusion] Flux2 tp support (#16219)

Co-authored-by: Mick <mickjagger19@icloud.com>
This commit is contained in:
Xiaoyu Zhang
2026-01-03 17:02:27 +08:00
committed by GitHub
parent 65b0b5b248
commit d0fb24ee7b
3 changed files with 132 additions and 83 deletions

View File

@@ -10,6 +10,7 @@ from functools import lru_cache
from pathlib import Path
from typing import Any, Dict, Optional
import torch
from dateutil.tz import UTC
import sglang
@@ -149,6 +150,12 @@ class StageProfiler:
self.logger.info(f"[{self.stage_name}] started...")
if (self.enabled and self.timings) or self.simple_log:
if (
os.environ.get("SGLANG_DIFFUSION_SYNC_STAGE_PROFILING", "0") == "1"
and self.stage_name.startswith("denoising_step_")
and torch.cuda.is_available()
):
torch.cuda.synchronize()
self.start_time = time.perf_counter()
return self
@@ -157,6 +164,12 @@ class StageProfiler:
if not ((self.enabled and self.timings) or self.simple_log):
return False
if (
os.environ.get("SGLANG_DIFFUSION_SYNC_STAGE_PROFILING", "0") == "1"
and self.stage_name.startswith("denoising_step_")
and torch.cuda.is_available()
):
torch.cuda.synchronize()
execution_time_s = time.perf_counter() - self.start_time
if exc_type: