REMI Lab
OPEN KNOWLEDGE / TOOLS

What does a gradient cost?

이 페이지의 내용

The patch model above has 1.98 million cells and runs 9,912 time steps. On one RTX A6000 a forward run takes about 17 s. The value and the gradient with respect to every cell of the design region take about 24 s, whether the region holds 12,400, 20,592 or 43,008 cells.

Bar chart of wall time on an RTX A6000 for a forward run, the value and gradient, and central differences, for the patch footprint, the design box and the whole substrate layer
BoxCellsForward (s)Value + gradient (s)Peak memory (GB)Central differences (derived, days)
patch footprint12,40017.0623.974.744.9
design box20,59216.7423.687.638.0
whole substrate layer (incl. 19,436 vacuum cells)43,00816.9124.3115.4916.8

What grows instead

Memory. The reverse pass keeps a per-step record for the cells of the design box, so peak device memory rises from 0.44–0.45 GB for a forward run to 4.7, 7.6 and 15.5 GB. For larger regions, Reduce Memory Use explains checkpointing, which trades recomputation for memory.

The central-difference column is not measured: it is 2 × N × the measured forward time.

Downloads

Back to top ↑