MCPcopy Create free account
hub / github.com/cli99/llm-analysis / ActivationRecomputation

Class ActivationRecomputation

llm_analysis/analysis.py:39–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38
39class ActivationRecomputation(Enum):
40 NONE = 0
41 """No activation recomputation; requires the most amount of memory."""
42
43 SELECTIVE = 1
44 """Selectively checkpoints and recomputes only parts of each transformer layer that
45 take up a considerable amount of memory but are not computationally expensive to
46 recompute, i.e. QK^T matrix multiply, softmax, softmax dropout, and attention over
47 V."""
48
49 FULL = 2
50 """Full activation recomputation stores the input to EVERY transformer layer, which
51 is sharded across the tensor parallel group, thus requiring an extra all-gather
52 (ignored for now) per layer and add communication overhead; requires the lease
53 amount of memory; requires an extra forward pass."""
54
55
56@total_ordering

Callers 3

trainingMethod · 0.85
trainFunction · 0.85

Calls

no outgoing calls

Tested by 1