Cache hooks: add `cache_context` to all official pipelines + TaylorSeer fallback when no context is set
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Follow-up from the review discussion on #14923 (comment) by @yiyixuxu, related to #14922.
Context
Stateful cache hooks get their per-call state from StateManager.context (src/diffusers/hooks/hooks.py). If the denoiser runs outside model.cache_context(...), it raises:
ValueError: No cache context is set. Wrap the denoiser call in `model.cache_context(name, ...)` before calling it.
Right now only some pipelines wrap their transformer calls (for example, pipeline_flux.py uses "cond" / "uncond"). The other Flux pipelines don't, so pipe.transformer.enable_cache(TaylorSeerCacheConfig(...)) fails on them (#14922).
Proposal
There are two parts, and they can be done separately:
-
Add
cache_contextto all officially supported pipelines.CacheContextnow carries more than the name (step_index,num_inference_steps,timestep,sigma), so pipelines should pass that loop information through the context manager in a consistent way.- Use accurate names. For example, distilled pipelines with a single model call per step shouldn't label it
"cond". They should either leave the name out or use a name that matches what the call actually is.
- Use accurate names. For example, distilled pipelines with a single model call per step shouldn't label it
-
TaylorSeer should work without a context manager. TaylorSeer doesn't actually need any context, so
TaylorSeerCacheConfigshould fall back to a default/single state when nocache_contextis set, instead of raising. Then it works on any pipeline or a bare model call, whether or not part 1 is done.
Related
- #14922 (Enable TaylorSeer for all Flux pipelines)
- #14923 (wraps Flux pipeline transformer calls in
cache_context)
cc @sayakpaul
Requested by Sayak Paul - Slack thread - Agent trace
- Vorherrschende Sprache
- Python
- Sterne
- 34.9k
- Forks
- 7.5k
- Ø Merge
- 3 T. 16 Std.
- Gemergte PRs (30 T.)
- 65
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus huggingface/diffusers
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
huggingface/diffusers#15363 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorEvtl. vergeben @chessing234 hat das vor 1 Tag übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
huggingface/diffusers#15337 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Multi-vector textual inversion uses only the first vector when the token has uppercase letters (transformers v5)Evtl. vergeben @sunhouy hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
huggingface/diffusers#15313 ·
Maintainer antworten meist innerhalb von 1 Tag
-
TCDScheduler advances the generator on the final step of a strength-truncated custom scheduleEvtl. vergeben @SIDDARTHAREDDY8 hat das vor 5 Tagen übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
huggingface/diffusers#15288 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
unload_textual_inversion(token) leaves the extra tokens of a multi-vector embedding behind, so it can't be loaded againEvtl. vergeben @sohailshk hat das vor 11 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
huggingface/diffusers#15211 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in huggingface/diffusers
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
Maintainer antworten meist innerhalb von 1 Tag
-
Unused loot bag group names left in dreamcraft en_US.langEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. OffenStatus: Triage Suggestion
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
GTNewHorizons/GT-New-Horizons-Modpack#27789 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug frontend sev-5
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
-
core good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
b4b code health next
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ESCOMP/CTSM#4330 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag