lingbot-map icon indicating copy to clipboard operation
lingbot-map copied to clipboard

Low memory version demo

Open YoshiRi opened this issue 7 months ago • 1 comments

YoshiRi avatar Apr 23 '26 10:04 YoshiRi

Confirming this fix on a 10 GB consumer card (RTX 3080). Without it I hit exactly the double-residency OOM this PR targets: torch.load(..., map_location=device) materializes the full ~4.6 GB checkpoint directly in VRAM, and then model.to(device) allocates a second copy before the first is released → OOM during load on anything with less than ~16 GB free.

Applying the map_location="cpu" change from this PR clears the load-time OOM. Full run on the bundled example/courthouse scene (286 frames):

  • GPU: RTX 3080, 10 GB (~8 GB usable; desktop compositor holds ~1.6 GB)
  • Env: Python 3.10, torch 2.8.0+cu128, --use_sdpa (FlashInfer unavailable)
  • After load: alloc 3.34 GB / reserved 3.36 GB
  • Inference: 286 frames in 38.1 s (~6.4 it/s)
  • Peak during inference: 6.39 GB (reserved peak 6.81 GB)
  • Result: full reconstruction, viser viewer live

One caveat worth flagging for 10 GB cards: the map_location change clears the load-time OOM, but the default streaming path still OOMs mid-sequence (around frame ~35 here) because the KV cache grows on the order of ~130 MB/frame. Adding --keyframe_interval 16 (only keyframes are cached; every frame is still predicted) is what keeps the peak at the 6.39 GB above — with full per-frame caching the same run OOMs before finishing.

Would be great to see this land — it's the minimal change that makes the Quick Start runnable on consumer GPUs. Happy to help test further if useful.

mseimys avatar Jul 18 '26 12:07 mseimys