r/MachineLearning • • 2h ago

Project Streaming compressed 4D volumes into NVIDIA fVDB, reducing RAM usage by up to 300x [P]

Post image

Hey folks,

I have been working on a 4D volumetric codec (VQField, originally spun out of my open-source VQVDB which is a ML compression algorithm) mostly for VFX/simulation caches, and I recently wondered if it could actually help with 3D/4D ML datasets that are painful to store and stream.

I put together a small C++/Python bridge that decodes compressed 4D archives directly into NVIDIA fVDB's layout on CPU, and tested it on Polymathic AI's The Well supernova dataset : https://vqfield.com/research/fvdb

The short version: it shrinks 2.3 GB down to ~38-47 MB (where Blosc2/Zstd only got ~1.1x), speeds up cold-cache GPU loads by about 3x over prepared FP32, and lands within +0.7% to +2.0% VRMSE on unseen test frames. I also ran comparisons against ZFP and SZ3 (including where 3D ZFP/SZ3 still win, like cold single-frame seeks).

This allows to keep massive datasets in RAM and only stream / decode what is necessary during training, for example, region of interests etc, a 32Gb system is able to hold 1.5Tb worth of compressed data in RAM :)

I am much more of a graphics/systems person than an ML researcher, so I would really appreciate honest opinions !

8 Upvotes

3 comments sorted by

2

u/tecedu 1h ago

Ooo I am working on something similar but for weather data files as well, its built on top of hdf5 and should have a hdf5plugin soon. Except I gave up our lossy version, but with the lossy version at 0.001% loss normalised, I got down to 2% filesizes compared to our raw files. (lossless at 14%, pcodec at 25%, bloscz + zstd at 30%)

I would say benchmark against pcodec as its the best compression algorithm for large float32,64 and int values now. And also put in some preprocessor if you can to get more accurate figures. And also that you 98.6% figure or your loss figures, I think you need to tweak it to have less loss based on experience, as I had to drop my 0.001 lossy version because it was deemed that it lost too much data. Assuming that you will face the same issues.

Also would suggest a simple hdf5plugin for this if you can. Makes integration a lot more easier than a cli.

1

u/ZephirFX 48m ago

wow sounds pretty cool ! I don't know much about all the scientific data format, compression to be completely honest. Mine was aimed at CG at first, then I saw the potential benefits in other application.

I don't want to lock myself into the "It's a plugin for XYZ", so my file format and SDK allows for almost everything :)

I'll give a go against pcodec !

1

u/tecedu 46m ago

I don't want to lock myself into the "It's a plugin for XYZ", so my file format and SDK allows for almost everything :)

Its not locking yourself in but rather just making it part of the existing tooling, your file format and all of your stuff still says but scientists can import that into python now and immediately write/read your datasets.