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?

ZCode – Harness for GLM-5.2

https://zcode.z.ai/en
95•chvid•1h ago•171 comments

Show HN: Searchable directory of 22k+ products from worker-owned co-ops

https://www.workerowned.info/
117•IESAI_ski•2h ago•21 comments

For first time, a cell built from scratch grows and divides

https://www.quantamagazine.org/for-the-first-time-a-cell-built-from-scratch-grows-and-divides-202...
664•defrost•8h ago•226 comments

What to learn to be a graphics programmer

https://blog.demofox.org/2026/07/01/what-to-learn-to-be-a-graphics-programmer/
193•atan2•5h ago•96 comments

Qualcomm Linux 2.0

https://www.qualcomm.com/developer/blog/2026/06/qualcomm-linux-2-now-available
27•gilgamesh3•2h ago•2 comments

FFmpeg 9.1's new AAC encoder

https://hydrogenaudio.org/index.php/topic,129691.0.html
245•ledoge•9h ago•82 comments

Physical disc production ending in Jan 2028 for new games on PlayStation

https://blog.playstation.com/2026/07/01/physical-disc-production-ending-in-january-2028-for-new-g...
542•Tiberium•11h ago•579 comments

Chip Off the Old Block

https://www.astralcodexten.com/p/chip-off-the-old-block
8•paulpauper•1h ago•0 comments

The Underhanded C Contest

https://underhanded-c.org/
10•ccabraldev•37m ago•2 comments

Box3D, an open source 3D physics engine

https://box2d.org/posts/2026/06/announcing-box3d/
385•makepanic•11h ago•85 comments

Proliferate (YC S25) Is Hiring

https://www.ycombinator.com/companies/proliferate/jobs/mMHvKR9-founding-product-engineer
1•pablo24602•2h ago

Internal Combustion Engine (2021)

https://ciechanow.ski/internal-combustion-engine/
260•StefanBatory•10h ago•61 comments

The GNU Emacs Architecture: Unlocking the Core [pdf]

https://www.diva-portal.org/smash/get/diva2:2052282/FULLTEXT01.pdf
43•cenazoic•8h ago•4 comments

Ask HN: Who is hiring? (July 2026)

145•whoishiring•8h ago•151 comments

Healthy but Sedentary People Show Early Decline in Cellular Energy Production

https://news.cuanschutz.edu/news-stories/healthy-but-sedentary-individuals-show-early-decline-in-...
6•littlexsparkee•27m ago•0 comments

Monetization Gateway: Charge for any resource behind Cloudflare via x402

https://blog.cloudflare.com/monetization-gateway/
225•soheilpro•9h ago•139 comments

Flavor Graveyard

https://www.benjerry.com/flavors/flavor-graveyard
12•NaOH•3d ago•5 comments

Fable 5 Is Back

https://twitter.com/claudeai/status/2072402636813607381
267•mfiguiere•3h ago•236 comments

Why jet engines aren't made in China

https://aakash.substack.com/p/why-jet-engines-arent-made-in-china
33•paulpauper•22h ago•11 comments

How We Made IPFS Content Publishing 10x Faster

https://probelab.io/blog/optimistic-provide/
134•dennis-tra•7h ago•43 comments

Launch HN: Parsewise (YC P25) – Reason Across Documents with an API

45•gergelycsegzi•9h ago•44 comments

Ask HN: Who wants to be hired? (July 2026)

101•whoishiring•8h ago•225 comments

Weave Robotics launches Isaac 1, a $7,999 home robot with Fall 2026 deliveries

https://www.weaverobotics.com/isaac-1
48•ryanmerket•5h ago•87 comments

The Apple Disk II Controller Card

https://www.bigmessowires.com/2021/11/12/the-amazing-disk-ii-controller-card/
23•stmw•2d ago•4 comments

Show HN: Cyclearchive.com – search vintage cycling magazines

https://cyclearchive.com/search/
4•alastairr•4d ago•1 comments

Client-side load balancing at a million requests per second

https://engineering.zalando.com/posts/2026/06/client-side-load-balancing.html?v=2](https://engine...
8•cjbooms•11h ago•1 comments

Hanami 3.0: In Full Bloom

https://hanakai.org/blog/2026/06/30/hanami-3-0-in-full-bloom
68•PuercoPop•5h ago•17 comments

1-Bit Pixel Art Emojis

https://hypertalking.com/2023/05/15/1-bit-pixel-art-emojis/
136•surprisetalk•6d ago•20 comments

Mortality associated with non-optimal ambient temperatures from 2000 to 2019

https://www.researchgate.net/publication/353058947_Global_regional_and_national_burden_of_mortali...
48•simonebrunozzi•5h ago•15 comments

I Left Harry's All-Night Hamburgers

https://escapepod.org/2013/09/14/ep413-why-i-left-harrys-all-night-hamburgers/
31•rbanffy•2h ago•7 comments