Keep your PyTorch model in VRAM by hot swapping code
Pytorch script hot swap: Change code without unloading your LLM from VRAM - valine/training-hot-swap
Keep your PyTorch model in VRAM by hot swapping code launched on April 21, 2025 with 77 votes, #553 of 7,818 launches that month and more than 95% of that year's launches. The site was still online in September 2026, 1 year on.
In plain words
This tool helps developers manage PyTorch model memory by automatically swapping code in and out of VRAM during execution. It's designed for machine learning engineers working with large models who need to optimize GPU memory usage without manually managing model loading and unloading. The software enables keeping models active while reducing memory overhead through intelligent code hot-swapping techniques.
written from the facts on this page · September 2026
From the sources
This is an example of how to hotswap PyTorch training code without unloading your model weights from VRAM. For large LLMs it can take upwards of 30 seconds to load a model from disk to VRAM. Waiting 30 seconds every time you want to rerun your script slows down development. This is a barebones implementation of a method to keep large models in VRAM even after your training script exits. If a model reload is necessary, it happens in the background after exit ensuring the model will be ready immediately the next time your script is run. This works by spawning a second process that stays active after your target script exits. The script you change is not run directly. Instead, this background…from github.com
Does a similar job
all alternatives →
PMBJun 2026 · pmbai.dev · ▲211PMB gives Claude Code, Cursor, Codex and Zed a real memory. Decisions, lessons and facts in one SQLite file on your disk. Offline, no API keys, no cloud.
LeanRL: Fast PyTorch RL with Torch.compile and CUDA Graphs2024 · github.com · ▲53We're excited to announce that we've open-sourced LeanRL, a lightweight PyTorch reinforcement learning library that provides recipes for fast RL training using torch.compile and CUDA graphs. By leveraging these tools, we've achieved significant speed-ups compared to the original CleanRL implementations - up to 6x faster! Reinforcement learning is notoriously CPU-bound due to the high frequency of small CPU operations. PyTorch's powerful compiler can help alleviate these issues, but comes with its own costs. LeanRL addresses this challenge by providing simple recipes to accelerate your…

- IMI made a GPU VRAM calculator for transformer-based models2023 · vram.asmirnov.xyz · ▲135
Rgpu – a PyTorch device whose tensors live on a remote GPU15d ago · github.com · ▲57Keep Python on your laptop. Run PyTorch operations and hold tensors on a remote GPU, including from a Mac with no CUDA installation. - ymcrcat/rgpu
More ai this month
the category →



Paintings by AI models: programs run through a simulation of oil paint.
AI · 20d ago · stillwet.art
PixVerse R2▲381A real-time world model you can explore and change
AI · 29d ago · world.pixverse.video

Source: Show HN post ↗
Launched alongside, April 2025
the whole month →
Hi everyone, I built PyXL — a hardware processor that executes a custom assembly generated from Python programs, without using a traditional interpreter or virtual machine. It compiles Python -> CPython Bytecode -> Instruction set designed for direct hardware execution. I’m sharing an early benchmark: a GPIO test where PyXL achieves a 480ns round-trip toggle — compared to 14-25 micro seconds on a MicroPython Pyboard - even though PyXL runs at a lower clock (100MHz vs. 168MHz). The design is stack-based, fully pipelined, and preserves Python's dynamic typing without static type restrictions.…
Dev tools · 2025 · runpyxl.com

The Unsure Calculator is an online tool that lets you calculate with numbers you’re not sure about.
Life & fun · 2025 · filiph.github.io

https://the-pocket.github.io/Tutorial-Codebase-Knowledge/
AI · 2025 · github.com


