Skip to content

Reduce host memory usage by storing images as uint8 - #248

Closed
miakh wants to merge 1 commit into
WebODM:mainfrom
miakh:uint8-host-images
Closed

Reduce host memory usage by storing images as uint8#248
miakh wants to merge 1 commit into
WebODM:mainfrom
miakh:uint8-host-images

Conversation

@miakh

@miakh miakh commented Sep 3, 2026

Copy link
Copy Markdown

Most input images are 8-bit, but OpenSplat currently keeps them in memory as float32. This change stores loaded images and image pyramids as uint8, converting them to float only when they are used.

In a quick RTX 3090 test, peak RAM dropped from 7.85 GiB to 2.67 GiB (66%) with no meaningful change in runtime or loss.

Tested on macOS/MPS and Linux/CUDA.

Addresses #134.

@pierotofy

Copy link
Copy Markdown
Member

What was the runtime difference? That's a lot of conversions.

@miakh

miakh commented Sep 3, 2026

Copy link
Copy Markdown
Author

This reduces host RAM, not GPU VRAM. Images are stored as uint8 in RAM and converted to the same float32 GPU tensors as before. With GPU caching, this normally happens only once per image. So there are no additional conversions. On the RTX 3090 test - GPU VRAM stayed at ~6.5 GiB.

Runtime was 19.22 vs. 18.81 seconds, so effectively unchanged.

On the M5鈥檚 unified memory, usage dropped from 12.08 to 9.49 GB (-21%) and runtime from 52.35 to 46.53 seconds (-11%), so - yea speedup but rather due to lower memory pressure.

Tested on the Person Hall dataset: 314 images at 5616脳3744, downscaled to 1404脳936 for training.

@pierotofy

Copy link
Copy Markdown
Member

Please don't submit any further pull requests. 馃檹

@pierotofy pierotofy closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants