Reduce host memory usage by storing images as uint8 - #248
Closed
miakh wants to merge 1 commit into
Closed
Conversation
Member
|
What was the runtime difference? That's a lot of conversions. |
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. |
Member
|
Please don't submit any further pull requests. 馃檹 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.