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?

How the European Commission rolled out Matrix to more than 40k staff

https://element.io/blog/how-the-european-commission-rolled-out-matrix-to-more-than-40-000-staff/
270•liotier•3h ago•116 comments

Garage Door Spam

https://blog.harrison.page/garage-door-spam/
163•harrisonpage•2d ago•59 comments

Nintendo takes Picofly firmware down from GitHub [video]

https://www.youtube.com/watch?v=-TLCGUpoD6c
67•cowlevel•23h ago•9 comments

Making 8-page foldable zines from a single A4 sheet in the browser

https://krthr.co/paper-folds-and-whats-new-in-fanzines-app/
24•krthr•46m ago•7 comments

Ruby2ßhell: Pre-authentication RCE on stock Rails

https://verialabs.com/ruby2shell/
239•jdns•8h ago•93 comments

What's New in PHP 8.6

https://www.php.net/releases/8.6/en.php
152•netol•4h ago•76 comments

We taught robots to carve marble sculptures

https://eleanorwiesler.com/blog/robotic-stone-carving/
40•ewiesler•21h ago•27 comments

Distributed, high-performance blob storage on SQLite

https://zerodha.tech/blog/high-performance-distributed-blob-storage/
129•ghostfoxgod•5h ago•23 comments

Mass launched to orbit each year by rocket builder

https://www.kadoa.com/companies/insights/spacex-europe-payload
40•hubraumhugo•1d ago•16 comments

Oregon library dropped Dewey Decimal system, adopted bookstore-like arrangement

https://www.fastcompany.com/91597520/oregon-library-ditched-dewey-decimal-wayfinding-system
46•bookofjoe•1d ago•30 comments

Gemini 4 Neon

https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-neon/
903•yigitdemirag•16h ago•710 comments

Show HN: Foolscap – a writing app that reads your book and never writes for you

https://foolscap.works/
10•atugard•43m ago•5 comments

SSD prices will start going down the second half of next year

https://www.drivevault.io/blog/when-will-hard-drive-prices-come-down.html
168•illidan1000•4h ago•141 comments

Two stealth models just appeared on the leaderboard, both ahead of Fable 5.2

https://contralabs.com/frontierdesign
36•cheptsov•3h ago•3 comments

Unblockable communication with gravity – Science Advances

https://www.science.org/doi/10.1126/sciadv.aee0802
21•rbanffy•1h ago•6 comments

Unauthenticated remote code execution in Nginx

https://www.wiz.io/blog/nginx-http2-rce-vulnerabilities
1445•speedping•22h ago•610 comments

15M web servers on one VM – smoltcp, DPDK, AF_XDP

https://kapteko.com/15-million-webservers/
247•fessguid•8h ago•28 comments

C's designated initializers give us named arguments

https://quuxplusone.github.io/blog/2026/11/16/named-arguments-in-c/
17•joshcsimmons•1d ago•9 comments

Exponential Behavior in Magic: The Gathering

https://levineuwirth.org/essays/exponential-magic/
25•neuwirth•23h ago•9 comments

The AI Superintelligence Debate Has Serious Flaws

https://spectrum.ieee.org/ai-superintelligence-debate
71•rbanffy•1h ago•74 comments

Multiple vulnerabilities in Regexp and String case conversion

https://www.ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string/
301•runesoerensen•14h ago•111 comments

Anthropic prices initial public offering

https://www.anthropic.com/news/anthropic-prices-initial-public-offering
306•surprisetalk•14h ago•577 comments

Someone reported java4shell bug in September 2026

https://github.com/openjdk/jdk/pull/32781
16•notmine1337•2h ago•1 comments

Seven new models at scalable price-performance

https://microsoft.ai/news/microsoft-ignite-2026/
570•gmays•21h ago•361 comments

Inside Deutsche Bank

https://www.inside-db.com/
737•gyre007•22h ago•245 comments

The first ping from Tonga (1997)

https://colo.to/firstping.html
57•Eric_Gullichsen•3d ago•6 comments

Logitech Harmony IR code online database archive

https://github.com/pickysysadmin/logitech-harmony-ir-archive
57•cf100clunk•2d ago•10 comments

LLM assisted reverse engineering

https://www.slowchronicle.com/posts/llm-assisted-reverse-engineering
265•ioma8•15h ago•67 comments

Building Lego Machines to Destroy Tall Lego Towers (2024)

https://kottke.org/24/07/building-lego-machines-to-destroy-tall-lego-towers
25•sammatilda•1d ago•3 comments

DaisyRose-27B

https://www.radixark.com/blog/daisyrose-27b
237•de_sty•18h ago•90 comments