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

未關閉
#15,322 1 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@sayakpaul 已經在處理了。

開始於 2026年11月17日。

  • #15331 來自 @sayakpaul —— 未關閉

評估

這個 Issue 還沒有評估資料。

描述

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.

主要語言
Python
星號
34.9k
分支
7.5k
平均合併
3 天 16 小時
30 天內合併 PR
65

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

huggingface/diffusers 的其他 Issue

查看 huggingface/diffusers 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。