frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Faster sorting with SIMD CUDA intrinsics (2024)

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

Comments

ashvardanian•10mo 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•10mo 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•10mo 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•10mo 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•10mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•10mo 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•10mo 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•10mo 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•10mo 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•10mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•10mo ago
What are the biggest use cases of GPU accelerated sorting?

Learnings from paying artists royalties for AI-generated art

https://www.kapwing.com/blog/learnings-from-paying-artists-royalties-for-ai-generated-art/
97•jenthoven•4h ago•55 comments

Two Years of Emacs Solo

https://www.rahuljuliato.com/posts/emacs-solo-two-years
160•celadevra_•6h ago•32 comments

Building a Procedural Hex Map with Wave Function Collapse

https://felixturner.github.io/hex-map-wfc/article/
453•imadr•13h ago•68 comments

Optimizing Top K in Postgres

https://www.paradedb.com/blog/optimizing-top-k
23•philippemnoel•1d ago•0 comments

Show HN: Remotely use my guitar tuner

https://realtuner.online/
147•smith-kyle•3d ago•36 comments

JSLinux Now Supports x86_64

https://bellard.org/jslinux/
291•TechTechTech•13h ago•80 comments

Show HN: I Was Here – Draw on street view, others can find your drawings

https://washere.live
9•mrktsm__•1h ago•0 comments

No, it doesn't cost Anthropic $5k per Claude Code user

https://martinalderson.com/posts/no-it-doesnt-cost-anthropic-5k-per-claude-code-user/
95•jnord•7h ago•38 comments

Is legal the same as legitimate: AI reimplementation and the erosion of copyleft

https://writings.hongminhee.org/2026/03/legal-vs-legitimate/
410•dahlia•15h ago•449 comments

Lotus 1-2-3 on the PC with DOS

https://stonetools.ghost.io/lotus123-dos/
19•TMWNN•3d ago•1 comments

Darkrealms BBS

http://www.darkrealms.ca/
76•TigerUniversity•3d ago•19 comments

Windows: Microsoft broke the only thing that mattered

https://www.yankodesign.com/2026/03/08/microsoft-broke-the-only-thing-that-actually-mattered/
53•kjellsbells•1h ago•32 comments

The “JVG algorithm” only wins on tiny numbers

https://scottaaronson.blog/?p=9615
51•jhalderm•5h ago•25 comments

Claude Code, Claude Cowork and Codex #5

https://thezvi.wordpress.com/2026/03/09/claude-code-claude-cowork-and-codex-5/
4•swolpers•1h ago•1 comments

So you want to write an “app” (2025)

https://arcanenibble.github.io/so-you-want-to-write-an-app.html
109•jmusall•9h ago•46 comments

Show HN: DenchClaw – Local CRM on Top of OpenClaw

https://github.com/DenchHQ/DenchClaw
111•kumar_abhirup•15h ago•95 comments

DARPA’s new X-76

https://www.darpa.mil/news/2026/darpa-new-x-76-speed-of-jet-freedom-of-helicopter
185•newer_vienna•13h ago•177 comments

Launch HN: Terminal Use (YC W26) – Vercel for filesystem-based agents

98•filipbalucha•13h ago•66 comments

A useless infinite scroll experiment

https://futile.ch/en/
9•dolin_ch•3d ago•6 comments

Amazon holds engineering meeting following AI-related outages

https://www.ft.com/content/7cab4ec7-4712-4137-b602-119a44f771de
15•petethomas•1h ago•5 comments

RVA23 Ends Speculation's Monopoly in RISC-V CPUs

https://semiwiki.com/ip/risc-v/367094-rva23-ends-speculations-monopoly-in-risc-v-cpus/
10•enz•2d ago•2 comments

OpenAI is walking away from expanding its Stargate data center with Oracle

https://www.cnbc.com/2026/03/09/oracle-is-building-yesterdays-data-centers-with-tomorrows-debt.html
315•spenvo•9h ago•167 comments

An opinionated take on how to do important research that matters

https://nicholas.carlini.com/writing/2026/how-to-win-a-best-paper-award.html
112•mad•14h ago•25 comments

The first airplane fatality

https://www.amusingplanet.com/2026/03/thomas-selfridge-first-airplane-fatality.html
78•Hooke•9h ago•19 comments

Florida judge rules red light camera tickets are unconstitutional

https://cbs12.com/news/local/florida-news-judge-rules-red-light-camera-tickets-unconstitutional
400•1970-01-01•13h ago•524 comments

Notes on Baking at the South Pole

https://www.newyorker.com/culture/the-weekend-essay/the-most-beautiful-freezer-in-the-world
50•mitchbob•11h ago•17 comments

Graphing how the 10k* most common English words define each other

https://wyattsell.com/experiments/word-graph/
32•wyattsell•2d ago•10 comments

No leap second will be introduced at the end of June 2026

https://lists.iana.org/hyperkitty/list/tz@iana.org/thread/P6D36VZSZBUSSTSMZKFXKF4T4IXWN23P/
95•speckx•18h ago•98 comments

Ireland shuts last coal plant, becomes 15th coal-free country in Europe (2025)

https://www.pv-magazine.com/2025/06/20/ireland-coal-free-ends-coal-power-generation-moneypoint/
925•robin_reala•20h ago•566 comments

Show HN: The Mog Programming Language

https://moglang.org
139•belisarius222•12h ago•67 comments