AnalysisDevelopersOctober 15, 2026

PyTorch knapsack solver swap cuts peak RAM 20x

Read original source →jedrzej.maczan.pl

Switching torch._functorch.config.activation_memory_budget_solver from the default dp to dp_knapsack_sliding_hirschberg cuts peak RAM during memory planning by a factor of 20. PyTorch models activation checkpointing as a 0/1 knapsack: within a RAM budget, it picks which ops to save versus recompute.

1 source

More stories today

Open the live feed