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?

Unlimited OCR: One-Shot Long-Horizon Parsing

https://github.com/baidu/Unlimited-OCR
69•ingve•1h ago•16 comments

The Coming Loop

https://lucumr.pocoo.org/2026/6/23/the-coming-loop/
42•ingve•1h ago•17 comments

Steam Machine launches today

https://store.steampowered.com/news/group/45479024/view/685257114654870245
1701•theschwa•19h ago•1450 comments

Plotnine

https://plotnine.org/
98•tosh•4d ago•22 comments

Will It Mythos?

https://swelljoe.com/post/will-it-mythos/
192•mindingnever•8h ago•128 comments

GLM-5.2 – How to Run Locally

https://unsloth.ai/docs/models/glm-5.2
444•TechTechTech•15h ago•198 comments

Crypto in 2026: Oh, This Is the Bad Place

https://www.stephendiehl.com/posts/bad_place_2026/
127•ibobev•2h ago•129 comments

VibeThinker: 3B param model that beats Opus 4.5 on reasoning with novel SFT+GRPO

https://arxiv.org/abs/2606.16140
246•timhigins•10h ago•105 comments

The Traditional Vi

https://ex-vi.sourceforge.net/
25•exvi•3h ago•9 comments

In praise of memcached

https://jchri.st/blog/in-praise-of-memcached/
195•j03b•11h ago•70 comments

Oracle shed about 20k roles globally in the last year

https://www.bbc.com/news/articles/c4gy0x0j5deo
53•Lyngbakr•59m ago•43 comments

8086 Segmented Memory was a good idea

https://owl.billpg.com/8086-segmented-memory-was-a-good-idea-almost/
34•billpg•1d ago•54 comments

Show HN: Neural Particle Automata

https://selforg-npa.github.io/
31•esychology•4h ago•7 comments

Apple is going to raise device prices, but when?

https://daringfireball.net/linked/2026/06/22/apple-device-prices-when
20•tosh•1h ago•12 comments

Show HN: Shumai – open-source Frame.io alternative for creative work

https://github.com/shumaiOne/shumai
11•Yiling-J•2h ago•0 comments

The new HTTP QUERY method explained

https://kreya.app/blog/new-http-query-method-explained/
179•CommonGuy•6h ago•106 comments

My Mathematical Regression

https://blog.dahl.dev/posts/my-mathematical-regression/
321•aleda145•4d ago•122 comments

OpenAI DayBreak – GPT-5.5-Cyber

https://openai.com/index/daybreak-securing-the-world/
132•AaronO•11h ago•85 comments

Wikipedia cofounder Larry Sanger blocked from editing Wikipedia

https://en.wikipedia.org/wiki/User:Larry_Sanger
29•FergusArgyll•1h ago•10 comments

Optocam Zero: a Pi Zero based digital camera made using off the shelf components

https://github.com/dorukkumkumoglu/optocamzero
190•iamnothere•17h ago•51 comments

An Introduction to YOLO26

https://blog.roboflow.com/yolo26/
83•teleforce•11h ago•29 comments

Moebius: 0.2B image inpainting model with 10B-level performance

https://hustvl.github.io/Moebius/
302•DSemba•23h ago•76 comments

Giant Banana Pulled Over: Driver Says Cops Have Stopped Him 100s of Times

https://cowboystatedaily.com/2026/06/18/giant-banana-pulled-over-in-montana-driver-says-cops-have...
76•speckx•2d ago•8 comments

Who Does What? Team Topologies for the Agentic Platform

https://blog.owulveryck.info/2026/06/22/who-does-what-team-topologies-for-the-agentic-platform.html
30•owulveryck•8h ago•12 comments

Epidurals are a miracle technology

https://worksinprogress.co/issue/the-wonder-of-epidurals/
12•karakoram•2d ago•1 comments

Improvements to Std:Format in C++26

https://mariusbancila.ro/blog/2026/06/19/improvements-to-stdformat-in-c26/
30•jandeboevrie•2d ago•15 comments

Show HN: Oak – Git alternative designed for agents

https://oak.space/oak/oak
197•zdgeier•21h ago•168 comments

Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

https://github.com/imtomt/ymawky/tree/linux
36•imtomt•8h ago•10 comments

Kyber (YC W23) Is Hiring a Head of Engineering

https://www.ycombinator.com/companies/kyber/jobs/FGmI8mx-head-of-engineering
1•asontha•15h ago

Matrix and Quaternion FAQ

https://j3d.org/matrix_faq/matrfaq_latest.html
16•signa11•8h ago•3 comments