Modern real-time video generation models such as Helios operate autoregressively: they produce video one chunk at a time, where each chunk is a fixed number of frames. Within each chunk, the model runs a diffusion denoising loop for a fixed number of steps. Understanding the relationship between chunk size, denoising steps, per-step latency, and context encoding overhead is essential for predicting whether a model can meet a real-time FPS target.
Write a function compute_video_generation_fps that calculates the end-to-end throughput of an autoregressive video generation pipeline.
The function should accept the following parameters:
num_chunks (int): Total number of video chunks to generatechunk_frames (int): Number of frames produced per chunkdenoising_steps (int): Number of diffusion denoising steps run per chunktime_per_step_ms (float): Wall-clock time in milliseconds for a single denoising stepcontext_encoding_ms (float, default 0.0): Additional overhead in milliseconds per chunk for encoding historical context (compressed history tokens, VAE encoding, etc.)realtime_fps_threshold (float, default 24.0): The FPS value at or above which generation is considered real-timeThe function should return a dictionary with the following keys:
total_frames (int): Total number of frames generated across all chunkstotal_time_ms (float): Total wall-clock generation time in millisecondstotal_time_s (float): Total time in seconds, rounded to 4 decimal placesfps (float): Frames per second, rounded to 2 decimal placestime_per_chunk_ms (float): Time spent generating a single chunk in millisecondsis_realtime (bool): True if fps >= realtime_fps_threshold