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•11mo ago
Code at https://github.com/wiwa/blog-code/

Comments

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

Simple self-distillation improves code generation

https://arxiv.org/abs/2604.01193
320•Anon84•6h ago•96 comments

Show HN: TurboQuant-WASM – Google's vector quantization in the browser

https://github.com/teamchong/turboquant-wasm
20•teamchong•1h ago•0 comments

German men 18-45 need military permit to leave country for longer than 3 months

https://www.dw.com/en/german-men-need-military-permit-for-extended-stays-abroad/a-76662677
83•L_226•57m ago•40 comments

Some Unusual Trees

https://thoughts.wyounas.com/p/some-unusual-trees
147•simplegeek•7h ago•43 comments

Tell HN: Anthropic no longer allowing Claude Code subscriptions to use OpenClaw

904•firloop•17h ago•703 comments

Author of "Careless People" banned from saying anything negative about Meta

https://www.thetimes.com/uk/technology-uk/article/sarah-wynn-williams-careless-people-meta-nrffdfpmf
225•macleginn•1h ago•160 comments

Components of a Coding Agent

https://magazine.sebastianraschka.com/p/components-of-a-coding-agent
32•MindGods•3h ago•5 comments

Artemis II crew take “spectacular” image of Earth

https://www.bbc.com/news/articles/ce8jzr423p9o
914•andsoitis•21h ago•318 comments

The Cathedral, the Bazaar, and the Winchester Mystery House

https://www.dbreunig.com/2026/03/26/winchester-mystery-house.html
91•dbreunig•3d ago•31 comments

Training mRNA Language Models Across 25 Species for $165

36•maziyar•2d ago•11 comments

The Indie Internet Index – submit your favorite sites

https://iii.social
10•freshman_dev•2h ago•1 comments

Claude Code Found a Linux Vulnerability Hidden for 23 Years

https://mtlynch.io/claude-code-found-linux-vulnerability/
208•eichin•16h ago•128 comments

Mbodi AI (YC P25) Is Hiring

https://www.ycombinator.com/companies/mbodi-ai/jobs/mf9L3sy-senior-robotics-engineer-systems-cont...
1•chitianhao•4h ago

Show HN: sllm – Split a GPU node with other developers, unlimited tokens

https://sllm.cloud
3•jrandolf•1h ago•0 comments

The most-disliked people in the publishing industry

https://www.woman-of-letters.com/p/the-most-disliked-people-in-the-publishing
60•Caiero•3d ago•21 comments

Why LLM-Generated Passwords Are Dangerously Insecure

https://www.irregular.com/publications/vibe-password-generation
11•zdw•2d ago•3 comments

OpenClaw privilege escalation vulnerability

https://nvd.nist.gov/vuln/detail/CVE-2026-33579
475•kykeonaut•1d ago•220 comments

iNaturalist

https://www.inaturalist.org/
493•bookofjoe•23h ago•116 comments

Herbie: Automatically improve imprecise floating point formulas

https://herbie.uwplse.org/doc/latest/tutorial.html
175•summarity•4d ago•33 comments

Run Linux containers on Android, no root required

https://github.com/ExTV/Podroid
187•politelemon•18h ago•64 comments

The smallest ELF executable (2021)

https://nathanotterness.com/2021/10/tiny_elf_modernized.html
22•michelangelo•3d ago•0 comments

Improving my focus by giving up my big monitor

https://ounapuu.ee/posts/2026/04/01/focus/
152•Fudgel•3d ago•158 comments

We replaced RAG with a virtual filesystem for our AI documentation assistant

https://www.mintlify.com/blog/how-we-built-a-virtual-filesystem-for-our-assistant
366•denssumesh•1d ago•141 comments

The Technocracy Movement of the 1930s

https://donotresearch.substack.com/p/welcome-to-the-technocracy
149•lazydogbrownfox•1d ago•116 comments

What changes when you turn a Linux box into a router

https://patrickmccanna.net/7-configuration-changes-that-turn-a-multi-homed-host-into-a-switch-rou...
201•0o_MrPatrick_o0•4d ago•53 comments

What life looks like on the most remote inhabited island

https://apps.npr.org/life-on-tristan-da-cunha/
3•brightbeige•16m ago•1 comments

Go on Embedded Systems and WebAssembly

https://tinygo.org/
187•uticus•23h ago•26 comments

Big-Endian Testing with QEMU

https://www.hanshq.net/big-endian-qemu.html
110•jandeboevrie•1d ago•115 comments

F-15E jet shot down over Iran

https://www.theguardian.com/world/2026/apr/03/us-fighter-jet-confirmed-shot-down-over-iran
565•tjwds•1d ago•1268 comments

Build your own Dial-up ISP with a Raspberry Pi

https://www.jeffgeerling.com/blog/2026/build-your-own-dial-up-isp-with-a-raspberry-pi/
191•arjunbajaj•1d ago•33 comments