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?

Pirating the Pirates

https://mubi.com/en/notebook/posts/pirating-the-pirates
223•piotrgrabowski•3h ago•77 comments

Hijacking the PS5's RTMP stream

https://yashgarg.dev/posts/hijacking-ps5-rtmp-stream/
113•ibobev•3h ago•28 comments

Joseph Szabo’s pictures of American adolescents

https://www.newyorker.com/culture/photo-booth/the-teen-portraits-that-captivated-sofia-coppola
23•prismatic•1h ago•1 comments

Show HN: HN.watch – Videos of all Hacker News posts

https://hn.watch/
98•mrborgen•4h ago•32 comments

Launch HN: Vespper (YC F24) – SOTA Docx MCP

https://www.vespper.com/blog/launching-vespper-docx-mcp
18•topaztee•2h ago•5 comments

Parley: Federated, decentralised chat that speaks plain IRC

https://git.mills.io/prologic/parley
254•davidcollantes•9h ago•126 comments

When did Google get so weird?

https://sancho.bearblog.dev/google-weird/
1754•sancho-panza•23h ago•960 comments

Who wrote Elizabeth I's most scathing letters?

https://www.smithsonianmag.com/history/who-wrote-elizabeth-is-most-scathing-letters-new-research-...
13•benbreen•1h ago•6 comments

Sonnet 5.5

https://www.anthropic.com/claude-sonnet-5-5
269•D2OQZG8l5BI1S06•1h ago•174 comments

GrapheneOS – When an app is slow

https://blog.wirelessmoves.com/2026/09/grapheneos-when-an-app-is-slow.html
34•speckx•1h ago•7 comments

I made a visual workspace for AI Automations

https://www.biom.dev/
13•jduhking•1h ago•9 comments

Windows 11½

https://definitelynotwindows.com/
230•jjbinx007•1h ago•67 comments

What heraldry and Japanese mon can teach about visual-identity generators

https://benovermyer.com/blog/2026/09/japanese-vs-western-heraldry/
46•bovermyer•4h ago•13 comments

OpenAI still doesn't seem to have a handle on all of its rogue AI activity

https://techcrunch.com/2026/09/28/openai-still-doesnt-seem-to-have-a-handle-on-all-of-its-rogue-a...
77•mikelgan•2h ago•70 comments

MongoDB CEO resigns to join Meta

https://www.reuters.com/technology/mongodb-ceo-desai-steps-down-lead-metas-enterprise-platform-20...
219•diek•4h ago•197 comments

MicroLLM Lab – Try 7 tiny LLM's in the browser

https://stateofutopia.com/experiments/microllmlab/
4•logicallee•36m ago•1 comments

So long Google, and thanks for all the nudes

https://lecaro.me/20260921-google-less.html
103•speckx•1h ago•37 comments

Cf: The Agentic CLI for the Cloudflare API

https://blog.cloudflare.com/cloudflare-cf-cli-launch/
50•macleos•4h ago•22 comments

Show HN: Destroy Any Website with Stickman

https://destroy.spritefusion.com/
33•HugoDz•3h ago•9 comments

Kids turned low-traffic NPR Spotify comments into a secret group chat

https://www.thisamericanlife.org/897/transcript
158•simonpure•3h ago•107 comments

37,500 border drawings: a map of the world as people remember it

https://www.habibicode.org/thedrawnworld
150•nicocarsui•10h ago•31 comments

What Would a Serious AI Product Look Like?

https://blog.glyph.im/2026/09/serious-ai-product.html
90•lumpa•8h ago•27 comments

Footguns with Postgres “at time zone 'UTC'”

https://bookofrevenue.com/blog/6ab81e9a97a13f0001f7e4e1/postgres-at-time-zone-u-does-not-do-what-...
150•birdculture•1d ago•88 comments

Coding Is Not Solved

https://blog.alexewerlof.com/p/coding-is-not-solved
360•firstSpeaker•5h ago•373 comments

The problem is not AI code, but not knowing about system architecture or intent

https://www.ssp.sh/brain/the-problem-is-not-the-ai-code-but-nobody-knows-anything-anymore/
308•zazuke•3h ago•201 comments

Solving a corn puzzle with CP-SAT

https://thill.me/2026/07/16/corn-puzzle-sat-solver.html
15•luu•22h ago•5 comments

Show HN: Free alternative to graphics design giants

https://scissor.studio/
78•sia_xi•10h ago•36 comments

Show HN: PaperMono, e-ink fridge magnet shopping list with mobile web page

https://github.com/seamusc/papermono-shopping-list
100•seamus_c•9h ago•50 comments

Owed a billion dollars in Nvidia stock

https://colo.to/nvidia-stock-narrative.html
1025•Eric_Gullichsen•17h ago•430 comments

Ember-1

https://fireworks.ai/blog/ember-1
571•gmays•1d ago•244 comments