Python function
run_denoising_step
run_denoising_step()β
max.pipelines.modeling.base.run_denoising_step(step, cache_state, cache_config, device, compute_fn, taylorseer=None)
Execute one denoising step with caching logic.
This is a standalone version of DiffusionPipeline.run_denoising_step
that does not require inheritance. The caller provides a compute_fn
callback that runs the transformer and returns the raw result tuple.
-
Parameters:
-
- step (int) β Current step index.
- cache_state (DenoisingCacheState) β Per-request mutable cache state for this stream.
- cache_config (DenoisingCacheConfig) β Cache configuration.
- device (Device) β Target device.
- compute_fn (Callable[[], tuple[Tensor, ...]]) β Callable that runs the transformer and returns the
result tuple. The tuple format depends on the cache mode:
(noise_pred,)for standard,(new_residual, noise_pred)for FBCache. - taylorseer (TaylorSeer | None) β Optional TaylorSeer instance. Required when
cache_config.taylorseeris True.
-
Returns:
-
noise_pred tensor for this step.
-
Return type:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!