[Project Showcase] Disk Sparse Adam (DSA) — A disk-backed SparseAdam for large embeddings and GNNs #3949
Assistentus
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi PyTorch Community!
I wanted to share an open-source library I’ve developed to solve a common memory bottleneck when training large-scale sparse models: Disk Sparse Adam (DSA).
The Problem: Memory Overheads in Large Sparse Embeddings
When training massive embedding tables (e.g., Knowledge Graph Embeddings or Graph Neural Networks with millions/billions of nodes), standard$m$ and $v$ ) for every single parameter.
torch.optim.SparseAdamrequires storing first and second momentum states (For multi-million-entity tables, these optimizer states quickly overwhelm GPU VRAM or system RAM, leading to
CUDA out of memory(OOM) or system crashes—especially on consumer-grade hardware or single-GPU setups.The Solution: Out-of-Core Sparse Adam (DSA)
Disk Sparse Adam (DSA) is an out-of-core sparse optimizer that offloads
SparseAdammomentum states to disk using efficient memory mapping (mmap).Instead of keeping gigabytes of momentum states in active RAM/VRAM, DSA streams and updates only the active sparse slices required for the current mini-batch, maintaining asynchronous sparse updates with near-zero VRAM overhead for optimizer states.
Key Features
Quick Usage Example
Best regards,
Maksim Khotinsky
All reactions