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?

Claude Haiku 5.5

https://www.anthropic.com/claude-haiku-5-5
615•sfkgtbor•5h ago•301 comments

Margaret Hamilton, who led software development for the Apollo program, has died

https://news.mit.edu/2026/margaret-hamilton-computing-pioneer-dies-1007
332•muglug•2h ago•31 comments

GPT‑6 and Intelligent UI for everyone

https://openai.com/index/gpt-6-for-everyone/
452•joshuawright11•5h ago•230 comments

Docker Agent

https://github.com/docker/docker-agent
158•saikatsg•5h ago•71 comments

Push ifs up and fors down: The idiom, its algebra, and its limits

https://debasishg.github.io/blog/push-ifs-up-fors-down/
86•speckx•4h ago•38 comments

Show HN: Bigwords.page – Turn any screen into a sign. The URL is the app

https://bigwords.page/
310•SpeakingOfBrad•7h ago•102 comments

Shipping JPEG XL in Chrome

https://developer.chrome.com/blog/jpeg-xl-in-chrome
467•AshleysBrain•12h ago•301 comments

If somebody tries to hot-patch an already-hot-patched function

https://devblogs.microsoft.com/oldnewthing/20261005-00/?p=112755/
26•ibobev•1d ago•6 comments

Navier–Stokes Lost in Translation

https://arxiv.org/abs/2610.08144
227•nill0•8h ago•149 comments

How machines learned precision

https://glinscott.github.io/how-machines-learned-precision/
89•glinscott•1d ago•40 comments

Animated ASCII Art for Web Pages

https://ascii.rest/
266•turrini•8h ago•56 comments

Brownian Motion

https://gregorygundersen.com/blog/2026/04/22/brownian-motion/
21•signa11•1d ago•0 comments

A new write and space optimized storage engine for MySQL is here

https://tidesdb.com/articles/tidesdb-now-available-for-mysql/
9•alexpadula•2d ago•1 comments

Meta and Microsoft take steps to reduce employee usage of Claude AI

https://www.rswebsols.com/news/meta-and-microsoft-take-steps-to-reduce-employee-usage-of-claude-ai/
244•speckx•4h ago•237 comments

A font recreated from photographs of classic Commodore 64 keycaps

https://github.com/szabadkai/c64-keyboard-font/
371•sohkamyung•14h ago•62 comments

Sharing AI progress in mathematics

https://openai.com/index/sharing-ai-progress-in-mathematics/
1215•OfficialTurkey•1d ago•1391 comments

House with 15m underground tunnels for sale for 300k

https://www.readingchronicle.co.uk/news/26612080.house-15m-underground-tunnels-sale-300k/
146•librasteve•10h ago•154 comments

Nobel Prize in Chemistry 2026 to Henri B. Kagan and Kenso Soai

https://www.nobelprize.org/prizes/chemistry/2026/press-release/
286•sasvari•13h ago•53 comments

Visa, Mastercard, major banks facing new litigation over 'anticompetitive' fees

https://www.classaction.org/news/visa-mastercard-major-banks-facing-new-litigation-over-anticompe...
457•DeepLogin•8h ago•319 comments

Wood Tape (2004)

http://gamesbyemail.com/WoodTape/Default.htm
142•NaOH•1d ago•17 comments

Google Playground: Create and play custom games

https://blog.google/innovation-and-ai/technology/ai/playground-experimental-gaming-platform/
107•acossta•11h ago•191 comments

SynthID Detector

https://synthid.com/
83•ilreb•9h ago•72 comments

Show HN: Agent.reviews – Where AI agents read and write reviews on tools

https://agent.reviews/
31•screm•6h ago•33 comments

Anti-patterns in software blogging

https://refactoringenglish.com/blog/anti-patterns-software-blogging/
193•ilreb•10h ago•110 comments

3D-printing platform rapidly produces complex electric machines

https://news.mit.edu/2026/3d-printing-platform-rapidly-produces-complex-electric-machines-0218
55•rbanffy•2d ago•26 comments

AI-assisted proof of optimal packing for 11 squares

https://github.com/Queuingtheorydotcom/11SquaresFormalized
104•bluepeter•9h ago•48 comments

God of War on PSP, recompiled to WebAssembly and running in the browser

https://github.com/snuri00/psp-web-recomp
144•sn001•12h ago•77 comments

Why were Victorian elites so effective?

https://worksinprogress.co/issue/the-seven-vices-of-highly-effective-victorians/
80•karakoram•8h ago•136 comments

The art of defusing a second world war bomb

https://www.theguardian.com/news/ng-interactive/2026/oct/06/it-could-knock-a-whole-street-down-th...
108•sandebert•19h ago•86 comments

ShinyHunters Extorted Boeing Spin-Off Prior to Arrests

https://krebsonsecurity.com/2026/10/shinyhunters-extorted-boeing-spin-off-prior-to-arrests/
69•speckx•8h ago•15 comments