Introduction
Diffusion Transformers (DiTs), such as Stable Diffusion 3 and FLUX, have established a new state-of-the-art for high-quality image generation. However, serving these models in production environments presents significant systems challenges. Production workloads often involve heterogeneous requests with varying resolutions—ranging from small thumbnails to 4K images—each associated with specific Service Level Objective (SLO) deadlines.
Current serving systems rely on Sequence Parallelism (SP) to distribute image generation across multiple GPUs. However, these systems typically employ a fixed degree of parallelism for the entire request duration. This leads to a "Goldilocks" dilemma: low parallelism is efficient for small images but causes large images to miss deadlines, while high parallelism accelerates large images but introduces prohibitive communication overhead for small ones, leading to resource waste and head-of-line blocking.
TetriServe: Dynamic Step-Level Scheduling
To address these inefficiencies, we present TetriServe, a specialized serving system that treats DiT serving as a dynamic packing problem. TetriServe moves away from rigid, fixed parallelism in favor of a deadline-aware, round-based scheduler.
The system's core innovations include:
- Step-Level Sequence Parallelism: Unlike Large Language Models (LLMs) which are stateful due to KV caches, DiT denoising is stateless between steps. TetriServe exploits this by dynamically reconfiguring the number of GPUs assigned to a request during its execution.
- Round-Based Scheduling: TetriServe discretizes time into fixed intervals called "rounds." At the start of each round, it determines which requests to execute and their optimal parallelism levels.
- DP-Based Request Packing: The scheduler solves a "group-knapsack" problem every round using Dynamic Programming (DP) to maximize the number of requests that meet their SLOs.
- Elastic Scale-Up: Any remaining idle GPU capacity is elastically assigned to active requests, further reducing latency and providing a buffer against future deadline misses.
The Communication Wall and Resolution Awareness
A key insight driving TetriServe is the non-linear relationship between parallelism and performance across different resolutions. For small images (e.g., 256x256), communication overhead can exceed 30% of total execution time when using high parallelism. Conversely, large images (e.g., 2048x2048) spend less than 10% on communication, benefiting significantly from higher GPU counts.
TetriServe leverages the high predictability of DiT execution—where step time for a given resolution and parallelism degree is nearly constant—to build an accurate cost model for its scheduler. The statelessness of DiTs enables these reconfigurations with negligible overhead (less than 0.05%).
Evaluation and Results
We evaluated TetriServe using FLUX.1-dev and Stable Diffusion 3 Medium across various prompt mixes from DiffusionDB. Key findings include:
- Improved SLO Attainment: TetriServe achieves up to a 32% increase in SLO attainment compared to fixed-parallelism baselines.
- Tail Latency Reduction: The system significantly mitigates the "long tail" of request latencies, ensuring consistent performance under load.
- Burst Robustness: TetriServe maintains stable success rates during traffic spikes, whereas fixed-parallelism systems often collapse due to queueing delays.
- Extensibility: When combined with other optimizations like Nirvana (a cache-based accelerator), TetriServe reached an 88% success rate, far surpassing baseline performance of 32-42%.
Conclusion
TetriServe demonstrates that by exploiting the stateless nature of DiT denoising steps and implementing resolution-aware, dynamic scheduling, we can significantly improve the efficiency and reliability of image generation services. Future work will explore scaling these step-level re-balancing techniques to multi-node clusters with diverse interconnect speeds.
Summary updated