0/1 Knapsack Problem in PyTorch

·Hacker News··

← main page pytorch algorithms compilers optimization Use 20x less peak RAM with dp_knapsack_sliding_hirschberg, a new activation memory budget solver for PyTorch 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. What? When PyTorch builds a computation graph of your ML model, it tries many different things to make it fast and memory

Read full article →

Related Articles

Every AI model has the same "controversial" take on humans
rakannimer · Hacker News · 5h ago
Jailbreaking the Switch 2
ledoge · Hacker News · 13h ago
The recently proposed o(n log n) integer multiplication algorithm [pdf]
craigcitro · Hacker News · 19h ago
Security Disclosure
passenger · Hacker News · 1d ago
The 1.5°C goal of the Paris Agreement is no longer viable
velo_aprx · Hacker News · 1d ago