A PyTorch memory snapshot viewer alternative to https://docs.pytorch.org/memory_viz with rich features. Display large snapshots smoothly!
-
Record Snapshot: Generate a memory snapshot of your PyTorch model. Refer to the official PyTorch documentation for detailed instructions.
-
Convert to ZIP: Convert the
.picklesnapshot to a.zipformat (compressed json) usingconvert_snap.py.# Install dependencies pip install -r requirements.txt # Convert snapshot python convert_snap.py -i snap/large.pickle -o snap/large.zip
-
Decompress converted snapshot: Unzip the snapshot to certain folder, say,
./large. You should see two files, namelyallocations.jsonandelements.db.unzip snap/large.zip -d ./large
Warning: This software is in pre-alpha stage. Everything including snapshot format, data storing/loading logic is under frequent change.
- You need Rust toolchain and Python installed.
- First you need a virtual environment (via
venvorconda). Here we use venv on windows:- Activate
venv.\.venv\Scripts\activate
- Install dependencies
pip install -r requirements.txt
- Activate
- Build the extension under release mode
maturin dev -r
- Specify resolution, log level and directory to your snapshot (which should have
allocations.jsonandelements.db), and run the application.- Tkinter application (tested on windows and linux)
python gui.py --log info --res 2400 1000 -d <dir_to_your_snapshot>
- Tkinter application (tested on windows and linux)
- Minimal dependency is not a goal.
- todo:
- reorganize where each function and struct should be placed
- clean code and rename functions
