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?

Linux support is coming to Snapdragon X2 Series

https://www.qualcomm.com/news/onq/2026/09/snapdragon-summit-agentic-ai-pcs-linux
182•aaronday•4h ago•78 comments

Claude discovers a novel enzyme system with CRISPR-like repeats

https://www.anthropic.com/news/claude-discovers-novel-enzyme-system
526•raahelb•8h ago•548 comments

Meta VR Glasses

https://www.meta.com/vr-glasses/
254•polymorph1sm•2h ago•220 comments

Feds Target AI Critics as "Foreign Agents"

https://www.kenklippenstein.com/p/feds-think-ai-critics-are-foreign
35•nmeagent•2h ago•15 comments

VSCode's SSH Agent Is Bananas (2025)

https://fly.io/blog/vscode-ssh-wtf/
139•Rapzid•5h ago•90 comments

ArXiv receives multiyear commitments to support it as an independent nonprofit

https://blog.arxiv.org/2026/09/23/arxiv-receives-multiyear-investment/
67•JohnHammersley•3h ago•11 comments

Virtio-nvgpu: Near-native Nvidia GPU access inside a KVM guest

https://github.com/nestrilabs/virtio-nvgpu
15•WanjohiRyan•1h ago•8 comments

The "Windows XP Box" (2003)

https://www.mini-itx.com/projects/windowsxpbox/
65•doubletwoyou•1d ago•10 comments

Mercury 2.5 LLM hits 770 tokens per second

https://artificialanalysis.ai/models/mercury-2-5
56•Retro_Dev•4h ago•27 comments

Fixing the Portobello Police Station Clock

https://pointinthecloud.com/2026-04-11-211700.html
384•avidly•11h ago•89 comments

We just shipped support for the ugliest part of HTTP: Vary

https://blog.cloudflare.com/vary-support/
88•thisisfatih•4h ago•15 comments

FLAWED's Flaws and What This Means for Industry Research

https://suhacker.ai/p/flaweds-flaws-and-what-this-means-for-industry-research/
11•tob_scott_a•1h ago•1 comments

Italian parliament votes for return to nuclear energy

https://apnews.com/article/italy-nuclear-chernobyl-4891b6b7c7791ae84db6b0bf0f7cf567
608•geox•9h ago•391 comments

LensVLM: Compressing long context as images, expanding only relevant pages

https://huggingface.co/apple/LensVLM-9B
60•victormustar•8h ago•7 comments

The mystery animal on an ancient god's head

https://signoregalilei.com/2026/09/13/the-mystery-animal-on-an-ancient-gods-head/
62•surprisetalk•1d ago•17 comments

Show HN: An open-source manufacturing ERP/MES/QMS

https://carbon.ms/self-hosted
10•barbinbrad•1h ago•6 comments

Making Tailscale Faster

https://tailscale.com/blog/making-tailscale-faster
88•yarapavan•8h ago•39 comments

A brief history of Windows scroll bar shortcuts

https://devblogs.microsoft.com/oldnewthing/20260922-00/?p=112719/
113•tybulewicz•8h ago•51 comments

Show HN: Combinators in Array Languages

https://blog.softwarewrighter.com/2026/09/21/rabbit-hole-sage-y-combinator/
4•softwarewright•2d ago•0 comments

Australia says OpenAI agent hacked into government website

https://www.channelnewsasia.com/world/australia-openai-agent-breach-government-portal-6406411
20•doppp•1h ago•8 comments

Gemini 3.8 text-to-speech

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-8-text-to-speech/
259•swolpers•11h ago•124 comments

Tokens too cheap to meter

https://jyn.dev/tokens-too-cheap-to-meter/
244•teoruiz•17h ago•181 comments

The Curious Power of Punctuation

https://www.newyorker.com/magazine/2026/09/28/on-the-mark-louis-menand-book-review
30•pepys•1d ago•5 comments

Radicle: Disclosure of Vulnerability in the Network Protocol

https://radicle.dev/2026/09/23/disclosure-of-vulnerability-in-network-protocol
126•lostmsu•11h ago•50 comments

Augustofaces: Pareidolia Fine Art

https://augusto.at/augustosfaces/
19•luu•1d ago•1 comments

Swap, ZRAM, Zswap and Hibernate on NixOS

https://blog.matthewbrunelle.com/swap-zram-zswap-and-hibernate-on-nixos/
44•speckx•8h ago•11 comments

I don't want the details

https://michaelheap.com/i-dont-want-the-details/
365•mooreds•13h ago•200 comments

A refined phylochronology of the second plague pandemic in Western Eurasia

https://www.pnas.org/doi/10.1073/pnas.2534899123
15•Thevet•3d ago•0 comments

Z80 REPL (2018)

https://abagames.github.io/z80-repl/index.html
149•adunk•15h ago•18 comments

QuestDB (YC S20) Is Hiring a Sales Engineer

https://questdb.com/careers/pre-sales-engineer-north-america/
1•nhourcard•14h ago