-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable roundtrip for nvCOMP batch codecs. #253
Enable roundtrip for nvCOMP batch codecs. #253
Conversation
Pull requests from external contributors require approval from a |
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, overall I think this looks good. One thing I wonder is whether we should just do all of the pointer manipulation in host buffers and then do a single round of H2D memcopies before calling into nvcomp
. Since I imagine the number of batches is not that large this is probably faster than lots of tiny (explicit and implicit) memcopies back and forth.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Two minor typographic fixes, plus (apologies I didn't spot this first time round), I wonder if we want to use memcpy2DAsync
to avoid the batch loop and kick everything off in one go. I don't think that's a necessary change though, so leave it up to you.
/ok to test |
/ok to test |
Thanks very much for this! We've just gone into code freeze so this will need to go to 23.10 rather than 23.08. Could you please retarget to |
Thank you for the review! I've updated the PR's target branch to |
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @Alexey-Kamenev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, looks good to me too.
/ok to test |
/merge |
Thanks @Alexey-Kamenev |
This PR enables a roundtrip between codecs other than LZ4. For LZ4 codec, there is already such support.
The "roundtrip" here means ability to compress/store data using default numcodecs codec (e.g.
zstd
) and decompress using nvCOMP batch codecs. Reverse would also be true: ability to compress data using nvCOMP and decompress using CPU numcodecs codec.The original implementation of the nvCOMP codec was based on the assumption, taken from numcodecs LZ4 codec, that in order for the codecs to be compatible, each codec must write a small header (4 bytes) in the compressed chunk, which contains the original, uncompressed size of the data. However, after subsequent analysis of other numcodecs codecs, it turned out LZ4 was actually an exception! No other codec writes a header or any additional data to the compressed chunk.
This PR:
nvcompBatched*GetDecompressSizeAsync
family of functions to get the original size of data during decompression.