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?

Deno Is Joining Cloudflare

https://deno.com/blog/cloudflare
669•ilreb•4h ago•355 comments

Our $445M Series D

https://oxide.computer/blog/our-445m-series-d
359•ahlCVA•4h ago•142 comments

Let your AI agents paint big arrows, boxes and text on your screen

https://github.com/franzenzenhofer/big-arrow-on-the-screen
289•franze•6h ago•121 comments

I'm in a Meeting

https://iminafleeting.com/
439•splintersio•8h ago•159 comments

Nobel Peace Prize for 2026 to Navanethem Pillay

https://www.nobelprize.org/prizes/peace/2026/press-release/
316•Anon84•7h ago•162 comments

Germany turning abandoned coal mines into 23 lakes, becoming artificial wetland

https://timesofindia.indiatimes.com/world/europe/germany-is-turning-abandoned-coal-mines-into-23-...
99•ohjeez•2h ago•41 comments

Python 3.15.0

https://www.python.org/downloads/release/python-3150/
193•ngoldbaum•2h ago•38 comments

Why isn't the industry freaking out about DeepSeek 4.1 Flash?

https://www.dgt.is/blog/2026-10-07-deepseek-freek-out/
973•jonotime•1d ago•888 comments

Whistle: Speech to Text in 16.9 MB

https://cactuscompute.com/blog/whistle
868•gmays•1d ago•172 comments

Tomek Korbak: OpenAI's head of safety told they no longer trust me

https://twitter.com/tomekkorbak/status/2108266859397283953
19•doener•33m ago•1 comments

Man discovers his parents' coffee machine used 1TB of data in 10 days

https://www.dexerto.com/entertainment/man-discovers-his-parents-coffee-machine-used-1tb-of-data-i...
868•ck2•2d ago•529 comments

Once: Cache CLI Commands

https://github.com/alex0ptr/once
65•baquero•7h ago•28 comments

US imposes sanctions on ICC hours after former judge wins Nobel Peace Prize

https://www.reuters.com/world/us-imposes-sanctions-international-criminal-court-hours-after-forme...
376•poly2it•2h ago•250 comments

MXC - a sandboxed code execution system

https://github.com/microsoft/mxc
130•nreece•11h ago•63 comments

I hired an illustrator to draw my house. Now it's my Home Assistant dashboard

https://antonfrolov.substack.com/p/i-hired-an-illustrator-to-draw-my
829•soheilpro•2d ago•180 comments

Yes, and

https://htmx.org/essays/yes-and/
647•Michelangelo11•1d ago•252 comments

Training Text-to-Image Models Without a VAE

https://www.linum.ai/field-notes/pyramid-jit
3•schopra909•2d ago•6 comments

Keyboard differences between Windows and Macs

https://unsung.aresluna.org/deeper-dive-keyboard-differences-between-windows-and-macs/
259•sohkamyung•14h ago•210 comments

Theranos.world

https://www.theranos.world/
520•kbyatnal•23h ago•188 comments

OpenAI fires three safety researchers for "mishandling research information"

https://techcrunch.com/2026/10/08/fired-openai-safety-researchers-dispute-misconduct-claims-warn-...
200•trakkstar•7h ago•98 comments

A statement on the Tor Project's relationship with Mullvad

https://blog.torproject.org/on-tor-relationship-with-mullvad/
38•runtimewire•1h ago•39 comments

Reactions to 100 Solutions

https://proofsandprompts.com/2026/10/08/100-reactions-to-100-solutions/
26•jacobedawson•4h ago•13 comments

Programming Isn't Special

https://blog.glyph.im/2026/10/programming-isnt-special.html
79•ingve•9h ago•72 comments

Study: Exercise increases cancer survival rates

https://www.nejm.org/doi/10.1056/NEJMoa2502760
65•RickJWagner•4h ago•34 comments

Imposing Sanctions on the International Criminal Court

https://www.state.gov/releases/office-of-the-spokesman/2026/10/imposing-sanctions-on-the-internat...
138•TechTechTech•2h ago•145 comments

Iranian campaign planted fake articles in real U.S. publications using ChatGPT

https://www.washingtonpost.com/technology/2026/10/09/chatgpt-users-iran-planted-ai-generated-arti...
144•cainxinth•5h ago•129 comments

Ask HN: What do you run on a $5 VPS that's worth keeping online 24/7?

349•mariocesar•2d ago•545 comments

The Hetzner Cloud network stack – history and technical overview

https://www.hetzner.com/blog/the-hetzner-cloud-network-stack-history-and-technical-overview/
74•cnkk•5h ago•22 comments

The value of not getting to the point (2015)

https://ken.arneson.name/2015/11/the-value-of-not-getting-to-the-point/
211•NaOH•22h ago•71 comments

OpenAI, the Partition Principle, and Mathematics

https://karagila.org/2026/openai-pp/
176•md224•17h ago•267 comments