Skip to content

Commit 4a696da

Browse files
Add how to cache model stuff to AGENTS.md
1 parent 95d755c commit 4a696da

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@
297297
- Avoid caches that persist across different executions as much as possible.
298298
Persistent caches are acceptable only when they use a very minimal amount of
299299
memory and have a clear ownership and invalidation story.
300+
- When condition-dependent model work would otherwise repeat on every denoising
301+
step and preprocessing it once materially improves performance, expose a
302+
model preprocessing method and call it from `BaseModel.extra_conds`, following
303+
patterns such as LTXAV and Anima. Pass the result through normal conditioning;
304+
do not add model-owned caches, sampler-option caches, or cache-management
305+
wrappers for this work.
300306
- When optimizing, favor small measurable changes: fewer allocations, fewer
301307
device transfers, less peak memory, better batching, or use of a faster
302308
existing backend op.

0 commit comments

Comments
 (0)