cache.md 1.14 KB
Newer Older
Aryan's avatar
Aryan committed
1
<!-- Copyright 2025 The HuggingFace Team. All rights reserved.
2
3
4
5
6
7
8
9
10
11
12
13

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License. -->

# Caching methods

Steven Liu's avatar
Steven Liu committed
14
Cache methods speedup diffusion transformers by storing and reusing intermediate outputs of specific layers, such as attention and feedforward layers, instead of recalculating them at each inference step.
15

Steven Liu's avatar
Steven Liu committed
16
## CacheMixin
17
18
19

[[autodoc]] CacheMixin

Steven Liu's avatar
Steven Liu committed
20
## PyramidAttentionBroadcastConfig
21
22
23
24

[[autodoc]] PyramidAttentionBroadcastConfig

[[autodoc]] apply_pyramid_attention_broadcast
Aryan's avatar
Aryan committed
25

Steven Liu's avatar
Steven Liu committed
26
## FasterCacheConfig
Aryan's avatar
Aryan committed
27
28
29
30

[[autodoc]] FasterCacheConfig

[[autodoc]] apply_faster_cache
Aryan's avatar
Aryan committed
31
32
33
34
35
36

### FirstBlockCacheConfig

[[autodoc]] FirstBlockCacheConfig

[[autodoc]] apply_first_block_cache