Skip to content

Tests don't catch cache_context calls that omit timestep #15322

Open

Description

@sayakpaul

PAB and FasterCache now read the current timestep from cache_context(name, timestep=...) (#14900). If a denoising loop leaves timestep out, both hooks raise a ValueError once the cache is enabled.

No test catches a call site that forgets it:

  • The model-level cache tests call cache_context themselves, so they never run a pipeline's denoising loop.
  • No modular pipeline test enables PAB or FasterCache, or checks what is passed to cache_context. The one exception is Cosmos 3, which checks step_index, sigma and num_inference_steps.
  • For the standard pipelines, only 11 test files use the PAB or FasterCache tester mixins (Flux, HunyuanVideo, Mochi, Allegro, Latte, CogVideoX).

This came up in #14900. Four call sites in the PAN 2, Kandinsky S2V and Qwen-Image 2.1 modular blocks were missing timestep. They were found in review, not by a test.

Suggestion: add a shared test to the pipeline and modular pipeline tester mixins that patches transformer.cache_context, runs the pipeline, and asserts every call received a timestep. The Cosmos 3 test test_transformer_cache_contexts_receive_exact_scheduler_info already does this for its own fields and could be generalized.

Activity

  1. self-assigned this
    on Nov 17, 2026
  2. sayakpaul commented on Nov 17, 2026

    @sayakpaul
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions