PyTorch gains knapsack solver option cutting memory-planning RAM use 20x
PyTorch's activation memory budget solver, which decides which operations in a computation graph to save versus recompute to fit a memory budget, has a new configurable algorithm called dp_knapsack_sliding_hirschberg. Switching the setting from the default dp to this new option reportedly reduces peak RAM usage during memory planning by roughly a factor of 20. The feature is described as a drop-in configuration change via torch._functorch.config.activation_memory_budget_solver.