Coder Social home page Coder Social logo

Comments (4)

Cyan4973 avatar Cyan4973 commented on July 27, 2024

You're very welcomed Artyom.

There are limits to what can be done in parallel.

Basically, compressing / decompressing a block involves 2 parts :

  • Match Copy
  • Entropy Coding

For the time being, entropy coding is completely independent within each block (this could change in the future). That means it's possible to encode / decode this stage within multiple blocks in parallel, store the result, and make it available to the next stage.

Unfortunately, Match Copy is not so kind. Especially during the decompression stage, decompressing a block requires access to previous blocks, which must therefore be already decoded. Serial in nature.

Going around this limitation would require independent blocks.
This is a valid use case btw : in many data structures, random access is important, so blocks are independent and tiny.

Small independent blocks hurt compression badly though. A mitigation solution is to use a shared dictionary, a kind of "static prefix" which is going to be used for all blocks. All block operations remain independent, and thus can be parallelized.

As one can guess, it's a pretty advanced topic. I believe a bit more work is required to get there.

In the meantime, if you are interested in challenging your CUDA skills, I can only invite you to try compressing / decompressing small independent blocks. It's going to be pretty difficult already, and will require you to get a good understanding of zstd internals.

from zstd.

tomByrer avatar tomByrer commented on July 27, 2024

When I was doing audio DSP programming, I found CUDA only helped in some scenarios, when processing savings was worth the data transfer costs. Usually I found SSE optimizations easier & less friction.

from zstd.

Cyan4973 avatar Cyan4973 commented on July 27, 2024

Should we keep this issue opened ?
Any new item in the foreseeable future ?

from zstd.

mailagentrus avatar mailagentrus commented on July 27, 2024

Close this issue, please. It is impossible to integrate cuda support for the foreseeable future...

from zstd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.