frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Faster sorting with SIMD CUDA intrinsics (2024)

https://winwang.blog/posts/bitonic-sort/
92•winwang•1y ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•1y ago
The article covers extremely important CUDA warp-level synchronization/exchange primitives, but it's not what is generally called SIMD in the CUDA land .

Most "CUDA SIMD" intrinsics are designed to process a 32-bit data pack containing 2x 16-bit or 4x 8-bit values (<https://docs.nvidia.com/cuda/cuda-math-api/cuda_math_api/gro...>). That significantly shrinks their applicability in most domains outside of video and string processing. I've had pretty high hopes for DPX on Hopper (<https://developer.nvidia.com/blog/boosting-dynamic-programmi...>) instructions and started integrating them in StringZilla last year, but the gains aren't huge.

winwang•1y ago
Oh wow, TIL, thanks. I usually call stuff like that SWAR, and every now-and-then I try to think of a way to (fruitfully) use it. The "SIMD" in this case was just an allusion to warp-wide functions looking like how one might use SIMD in CPU code, as opposed to typical SIMT CUDA.

Also, StringZilla looks amazing -- I just became your 1000th Github follower :)

ashvardanian•1y ago
Thanks, appreciate the gesture :)

Traditional SWAR on GPUs is a fascinating topic. I've begun assembling a set of synthetic benchmarks to compare DP4A vs. DPX (<https://github.com/ashvardanian/less_slow.cpp/pull/35>), but it feels incomplete without SWAR. My working hypothesis is that 64-bit SWAR on properly aligned data could be very useful in GPGPU, though FMA/MIN/MAX operations in that PR might not be the clearest showcase of its strengths. Do you have a better example or use case in mind?

winwang•1y ago
I don't -- unfortunately not too well-versed in this field! But I was a bit fascinated with SWAR after I randomly thought of how to prefix-sum with int multiplication, later finding out that it is indeed an old trick as I suspected (I'm definitely not on this thread btw): https://mastodon.social/@dougall/109913251096277108

As for 64-bit... well, I mostly avoid using high-end GPUs, but I was of the impression that i64 is just simulated. In fact, I was thinking of using the full warp as a "pipeline" to implement u32 division (mostly as a joke), almost like anti-SWAR. There was some old-ish paper detailing arithmetic latencies in GPUs and division was approximately more than 32x multiplication (...or I could be misremembering).

bobmcnamara•1y ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•1y ago
Interesting stuff. Not sure if I read this right that it‘s 16 und 32 bit values of integers that get sorted. If yes, I‘d love to see if the GPU implementation can beat a competitive Radix sort implementation on a CPU.
winwang•1y ago
It's 32 32-bit values which get sorted. I don't think a GPU sort would beat a CPU sort at this scale, even if you don't take kernel launch time into account. CPUs are simply too fast for (super-)small data, especially with AVX-512. But if we're talking about a larger amount of data, that would be a different story, i.e. as part of a normal gpu mergesort.
maeln•1y ago
It is also useful if your data already lives on the GPU memory. For example, when you need to z-sort a bunch of particles in a 3d renderer particle system.
exDM69•1y ago
A 32 way GPU sorting algorithm might be just what I need for sorting and deduplicating triangle id's in a visibility buffer renderer I am working on.

Thanks for sharing.

winwang•1y ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•1y ago
What are the biggest use cases of GPU accelerated sorting?

Joint statement from Anthropic and OpenAI on recent advances in cryptography

https://www.anthropic.com/news/joint-statement-cryptography
268•aghuang•1h ago•220 comments

OpenSSH: "switch default key type generated to ECDSA NISTP384"

https://github.com/openssh/openssh-portable/commit/5b63da24d393ec5f08ec4371e09b692fc86587a8
379•throw0101d•6h ago•178 comments

Mistral Vibe: The coding agent for chonky codebases

https://mistral.ai/products/vibe/
131•doener•3h ago•47 comments

Google Play Integrity locks out alternative operating systems

https://consumerrights.wiki/w/Google_Play_Integrity_locks_out_alternative_operating_systems
645•DeepLogin•12h ago•291 comments

Why not rewrite ESLint in Rust?

https://github.com/eslint/eslint/discussions/21626
150•ksec•5h ago•147 comments

OpenEMR Electronic Health Record Platform Under Siege

https://www.vulncheck.com/blog/openemr-under-siege
91•ersinesen•6h ago•27 comments

Reinforcement Learning from Verifiable Rewards (eBook)

https://rlvrbook.com/
55•jonbaer•4h ago•3 comments

AI-Driven Scam Economy: Persuasion Knowledge, Consumer Vulnerability Empowerment

https://journals.sagepub.com/doi/10.1177/10949968261487442
51•rbanffy•4h ago•9 comments

OpenAI mcpfs: MCP Filesystem Tools

https://github.com/openai/mcpfs
77•tosh•5h ago•43 comments

Just know stuff. (Or, how to achieve success in a machine learning PhD)

https://kidger.site/thoughts/just-know-stuff/
38•learner_yearner•5h ago•12 comments

For random numbers on the GPU, encrypt a counter

https://klauria.tech/for-random-numbers-on-the-gpu-encrypt-a-counter/
7•evakhoury•2d ago•0 comments

Show HN: Post-quantum secure boot for the ESP32 and Pico 2

https://github.com/microtun/microtun-boot
58•dpeckett•6h ago•17 comments

Show HN: Scene.p10node – A handbook of camera angles, shots and film technique

https://scene.p10node.org/en
94•pierreneter•2d ago•7 comments

Congress Could Put Encrypted Messaging at Risk in Next Week's Defense Vote

https://www.eff.org/deeplinks/2026/12/congress-could-put-encrypted-messaging-risk-next-weeks-defe...
45•nickslaughter02•1h ago•5 comments

Forced Colour Testing

https://www.24a11y.com/2026/forced-colour-testing/
12•robin_reala•2d ago•0 comments

Your Attention Costs $100k

https://tornikeo.com/your-attention-costs-100k/
866•tornikeo•8h ago•392 comments

Are Your Hardware Keys Still Safe? Steelmanning the NSA Panic

https://vpetersson.com/2026/12/05/are-your-hardware-keys-still-safe/
47•mvip•4h ago•22 comments

FreeHand

https://microsoft.github.io/FreeHand/
272•jhack•13h ago•126 comments

BetterSPICE is a free SPICE circuit simulator

https://bspicesim.com/
221•zdw•14h ago•81 comments

Exercise may increase muscle size primarily by reducing protein breakdown

https://www.cell.com/iscience/fulltext/S2589-0042(26)03807-1
108•gavinray•4h ago•31 comments

Make Me a Million-Bench: a benchmark where AIs build companies in the real world

https://andonlabs.com/evals/mmm-bench
245•lukaspetersson•17h ago•168 comments

A growing number of heists target cargoes of kit for data centres

https://www.economist.com/united-states/2026/12/03/the-other-tech-smuggling-scheme
24•edward•5h ago•3 comments

California to require businesses to provide customers with human support

https://calmatters.digitaldemocracy.org/bills/b-29278
522•DeepLogin•10h ago•317 comments

Website where an animated cat generates your password

https://www.catpassword.com
155•thunderbong•5h ago•51 comments

What broke when I enabled PQC for Git and SSH

https://nordlenord.github.io/my-shared-notes/?id=f86ed9e6f4ac17225617717a5a14255f
191•tukHelix•14h ago•74 comments

Making cement in seconds just needs a big microwave

https://arstechnica.com/science/2026/12/making-cement-in-seconds-just-needs-a-really-big-microwave/
94•amooe•3d ago•45 comments

NSA, NIST, and post-quantum cryptography (2022)

https://blog.cr.yp.to/20220805-nsa.html
184•frostbyte64•12h ago•22 comments

AI Cyberattack on the Government of Canada has left defence vulnerable

https://www.ctvnews.ca/sci-tech/article/why-some-defence-companies-feel-exposed-after-the-ai-cybe...
59•ClearwayLaw•3h ago•9 comments

Drop the FFN – A Column Attention Transformer for TinyStories

https://github.com/jiaminres/drop-the-ffn
24•gaojiamin•6h ago•1 comments

Intellectual Debt After Generative AI

https://www.noemamag.com/intellectual-debt-after-generative-ai/
659•theanonymousone•1d ago•444 comments