FidelityFX-ParallelSort icon indicating copy to clipboard operation
FidelityFX-ParallelSort copied to clipboard

[Feature Request] Implement optimizations from OneSweep

Open natevm opened this issue 2 years ago • 2 comments

Not sure this is the right place for feature requests, but I’m curious if anyone here has considered moving to the “OneSweep” sort used in CUB.

Link to arxiv paper below: https://arxiv.org/abs/2206.01784

In theory, this would be much faster than the four way binned historgram approach used by FFX, since OneSweep sorts 8 bits at a time and with 2n global memory read/write operations over four binning iterations over 32 bit keys rather than then the 3n read/read/write operations in the four way radix over 8 iterations.

The method requires a forward progress guarantee, but iiuc RDNA supports this now (at least if I understand the RDNA white paper correctly)

natevm avatar Nov 03 '23 17:11 natevm

Hi,

Thank you for your feedback. I've made a note of this for something to explore for future developments within the SDK. Bare in mind that I wouldn't expect we'll able to look into this for a while, but it is interesting nonetheless. Thank you kindly for the suggestion.

jlacroixAMD avatar Nov 06 '23 05:11 jlacroixAMD

No problem.

Fwiw, there appears to be an open source implementation here, though I haven’t tested yet. Might be a good reference: https://github.com/b0nes164/ShaderOneSweep

natevm avatar Nov 06 '23 07:11 natevm