Tests don't catch `cache_context` calls that omit `timestep`

Ouverte
#15,322 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@sayakpaul y travaille déjà.

Depuis le 17/11/2026.

  • #15331 par @sayakpaul — ouverte

Évaluation

Cette issue n'a pas encore été évaluée.

Description

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.

Langage dominant
Python
Étoiles
34.9k
Forks
7.5k
Merge moyen
3 j 16 h
PR mergées (30 j)
65

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de huggingface/diffusers

Toutes les issues de huggingface/diffusers

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.