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?

IP Crawl: Living atlas of open webcams discovered on the public internet

https://ipcrawl.com/
138•arm32•3h ago•78 comments

Anonymous GitHub account mass-dropping undisclosed 0-days

https://github.com/bikini/exploitarium
562•binyu•7h ago•225 comments

OpenRA

https://www.openra.net/
507•tosh•10h ago•92 comments

Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work

https://github.com/kageroumado/adrafinil
40•kageroumado•1h ago•31 comments

AI learns the “dark art” of RFIC design

https://spectrum.ieee.org/ai-radio-chip-design
159•Brajeshwar•3d ago•100 comments

DSpark: Speculative decoding accelerates LLM inference [pdf]

https://github.com/deepseek-ai/DeepSpec/blob/main/DSpark_paper.pdf
704•aurenvale•13h ago•289 comments

'Careless People' author claims Meta surveilled her for 12mos to enforce silence

https://fortune.com/2026/06/26/meta-wynn-williams-surveillance-gag-order-lawsuit-2026/
92•1vuio0pswjnm7•1h ago•25 comments

Turn your site into a place people can bump into each other

https://cauenapier.com/blog/townsquare_release/
111•eustoria•5h ago•58 comments

Fintech Engineering Handbook

https://w.pitula.me/fintech-engineering-handbook/
424•signa11•11h ago•144 comments

Suspicious Discontinuities (2020)

https://danluu.com/discontinuities/
188•tosh•8h ago•44 comments

Paradise Revisited: What Darwin Saw in the Galápagos

https://www.theatlantic.com/magazine/2026/08/writers-way-galapagos-charles-darwin-travel/687480/
18•benbreen•3d ago•0 comments

The case for physical media ownership

https://dervis.de/physical/
324•cemdervis•10h ago•216 comments

Post-Mythos Cybersecurity: Keep calm and carry on

https://cephalosec.com/blog/cybersecurity-in-the-post-mythos-era-keep-calm-and-carry-on/
119•Versipelle•7h ago•35 comments

GLP-1 drugs led to weight loss and reversed depression-like behavior in mice

https://www.psychologytoday.com/au/blog/mood-by-microbe/202606/what-ozempic-does-to-the-gut-brain...
19•randycupertino•47m ago•3 comments

Michigan spent $1.8B and only created 602 jobs

https://www.msn.com/en-us/money/general/michigan-spent-1-8-billion-and-only-created-602-jobs/ar-A...
20•littlexsparkee•36m ago•5 comments

How do you keep Web MIDI from crashing a 1983 synthesizer?

https://knob.monster/how-do-you-keep-web-midi-from-crashing-a-1983-synthesizer
4•halfradaition•3d ago•3 comments

Supabase (YC S20) Is Hiring for Multigres

https://jobs.ashbyhq.com/supabase/2e718684-4f75-4a99-8d6b-3b6bd44e4228
1•awalias•5h ago

Reducing tick density along recreational trails in Ottawa, Canada

https://www.sciencedirect.com/science/article/pii/S1877959X26000476
116•bushwart•3d ago•65 comments

One man, two kernels, and a lot of RISC-V

https://www.theregister.com/software/2026/06/26/one-man-two-kernels-and-a-lot-of-risc-v/5262858
65•LorenDB•1d ago•5 comments

The eerie interface of man and machine (Life Magazine, October 1967)

https://blog.jgc.org/2026/06/the-eerie-interface-of-man-and-machine.html
17•Brajeshwar•3d ago•0 comments

Asian AI startups launch Mythos-like models

https://techcrunch.com/2026/06/27/asian-ai-startups-launch-mythos-like-models-as-anthropics-expor...
92•bogdiyan•9h ago•82 comments

Running a software jam in a world of slop

https://foxmoss.com/blog/radish/
27•foxmoss•8h ago•6 comments

Should European housing politics be Americanized?

https://worksinprogress.co/issue/should-european-housing-politics-be-americanized/
7•JumpCrisscross•1h ago•12 comments

Long Wave radio era set to end with switch-off

https://www.economist.com/britain/2026/06/25/the-bbc-switches-off-its-oldest-service
154•edward•2d ago•152 comments

Zuckerberg's war on whistleblowers

https://pluralistic.net/2026/06/27/zuckerstreisand-2/
548•HotGarbage•7h ago•201 comments

A History of Menus Is a Menu of History

https://pudding.cool/2026/06/menu-story/
35•surprisetalk•2d ago•6 comments

The US Army Issued Ocarinas to Soldiers in World War II

https://www.flutetunes.com/articles/my-flute-goes-to-war/
137•tomcam•2d ago•67 comments

How H-E-B became Texas' most beloved brand (2024)

https://texashighways.com/culture/how-heb-became-texas-most-beloved-brand/
71•NaOH•3d ago•67 comments

How Many Elementary Particles Are There, Really?

https://www.quantamagazine.org/how-many-elementary-particles-are-there-really-20260615/
112•rwmj•9h ago•97 comments

Linux on Older Hardware: The Complete Revival Guide

https://www.fosslinux.com/158206/linux-on-older-hardware-revival-guide.htm
188•tapanjk•2d ago•109 comments