Ponowne liczenie aktywacji (gradient checkpointing)

Gradient (activation) checkpointing · id gradcheckpointing · aliases: gradient checkpointing, activation checkpointing, activation recomputation, rematerialization, rematerializacja

Zapamiętuje się tylko wybrane aktywacje, a brakujące oblicza ponownie podczas propagacji wstecznej.

Only selected activations are stored; the missing ones are recomputed during backpropagation.

In one sentence

Model w trakcie nauki zapisuje tylko niektóre wyniki pośrednie, a resztę liczy jeszcze raz, gdy będą potrzebne.

While training, the model saves only some intermediate results and recalculates the rest when they're needed.

Problem it solves

Wyniki pośrednie każdej warstwy zajmują ogromną pamięć, szczególnie przy długich tekstach i głębokich modelach.

Intermediate results from every layer take huge amounts of memory, especially with long texts and deep models.

What it does

Jak notowanie wyniku co dziesiątej strony obliczeń: gdy potrzebujesz czegoś ze środka, przeliczasz od najbliższej notatki.

Like noting a result every tenth page of calculations: when you need something in between, you redo it from the nearest note.

Everyday example

Dostrajasz model na długich umowach i po włączeniu tej opcji trening przestaje się przerywać z braku pamięci.

You fine-tune a model on long contracts, and after switching this on, training stops crashing for lack of memory.

This concerns you if you…

Sources