0/1 Knapsack Problem in PyTorch
What happened
TL;DR: If you use a default torch._functorch.config.activation_memory_budget_solver=dp, you can change it to dp_knapsack_sliding_hirschberg and decrease your peak RAM usage during memory planning by a factor of 20.
Summary assembled by rule from the sources below