Get the latest tech news

0/1 Knapsack Problem in PyTorch


L;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. When PyTorch builds a computation graph of your ML model, it tries many different things to make it fast and memory efficient.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of PyTorch

PyTorch

Photo of Knapsack Problem

Knapsack Problem

Related news:

News photo

Mesa Expands NPU Capabilities With Support For YOLOX With PyTorch

News photo

Show HN: Rgpu – a PyTorch device whose tensors live on a remote GPU

News photo

The whole of PyTorch on one page