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?

Dystopian Surveillance Is Becoming a Reality

https://dallincrump.com/dystopian-surveillance-is-becoming-a-reality
33•speckx•9m ago•2 comments

Show HN: An e-ink frame that hears birds and draws them as 1800s illustrations

https://github.com/arnegiacomo/fugleramme
758•arnemunthekaas•5h ago•111 comments

Show HN: Capsule – Single-file web apps that save their data into SQLite

https://withcapsule.app/
169•bashtian•4h ago•89 comments

I can't stop thinking about Papua New Guinea

https://notnottalmud.substack.com/p/why-i-cant-stop-thinking-about-papua
770•networked•11h ago•329 comments

Show HN: Hacking a $20 4G wireless hotspot into a texting device

https://bkovac.github.io/modem-thing/
118•bobili1234•4h ago•18 comments

GEFS on OpenBSD: A Early Preview

https://marc.info/?l=openbsd-tech&m=178948744271633&w=2
12•sippingabonedry•35m ago•1 comments

Jiga (YC W21) Is Hiring Product Engineer (Remote/US)

https://jiga.io/about-us/?ashby_jid=0b75d72d-c92b-4dca-8062-09d298ada0bd
1•grmmph•46m ago

There's a 100% Chance AI Agents Are Ruining the Internet

https://www.404media.co/theres-a-100-chance-ai-agents-are-already-ruining-the-internet/
124•pavel_lishin•1h ago•67 comments

Cartesian – AI 3D Modeling for Design

https://www.formas.ai/cartesian
50•eustoria•2h ago•45 comments

The CSS Zen Garden dream, finally shipped

https://josprague.com/blog/the-css-zen-garden-dream-finally-shipped/
46•yosito•3h ago•19 comments

Let's make quality the norm again

https://www.forbrukerradet.no/short-life/
149•ingve•7h ago•145 comments

Why Personal Websites Are Coming Back

https://deadparrotbbs.com/why-personal-websites-are-coming-back/
3•speckx•19m ago•0 comments

The Inference Hardware Revolution of 2026

https://spectrum.ieee.org/inference-hardware-revolution
22•vinhnx•3h ago•0 comments

Archiving pirate radio station Kool FM

https://londonist.com/london/music/kool-fm-archives
48•rdmuser•1d ago•21 comments

Closing the IPv6 first-packet gap with GRAND

https://labs.ripe.net/author/pouria/closing-the-ipv6-first-packet-gap-with-grand/
16•m_montazeri•3h ago•12 comments

25 years of mass surveillance is enough

https://www.schneier.com/blog/archives/2026/09/25-years-of-mass-surveillance-is-enough.html
558•iamnothere•6h ago•178 comments

Alternatives to MinIO for single-node local S3

https://rmoff.net/2026/01/14/alternatives-to-minio-for-single-node-local-s3/
191•rmoff•9h ago•79 comments

Most people prefer traditional architecture

https://www.worksinprogress.news/p/do-people-prefer-traditional-architecture
126•alihm•1d ago•42 comments

Sony's First Computer – The SMC-70 from 1982 [video]

https://www.youtube.com/watch?v=cT2-7KkPkBc
44•ksymph•2d ago•8 comments

Show HN: Panel – A research workspace where the agent can build its own panes

https://github.com/greentfrapp/panel
36•greentfrapp•3h ago•6 comments

CSS-Tricks in Limbo

https://vale.rocks/micros/20260915-0135
213•edent•10h ago•81 comments

US confirms for first time it has deployed space weapons

https://www.bbc.com/news/articles/ck790xg41ygro
294•harporoeder•13h ago•191 comments

A single firm is behind OpenAI, Anthropic, and Meta hacking scandals

https://www.effort.news/irregular
146•yusufozkan•20h ago•43 comments

America's Driver's License Breach Is a National Security Disaster

https://www.lawfaremedia.org/article/america%27s-drivers-licence-breach-is-a-national-security-di...
44•hn_acker•1h ago•11 comments

A rough guide for going back to the Moon

https://research.ibm.com/blog/nasa-ibm-lunar-foundation-model
42•gmays•1d ago•64 comments

Fixing an NZXT Signal 4K30 part 2: the green/pink video bug

https://www.downtowndougbrown.com/2026/09/fixing-an-nzxt-signal-4k30-part-2-the-green-pink-video-...
16•zdw•1d ago•2 comments

How much of F-Droid is LLM generated?

https://tintotint.eu/whacky-corner/f-droid_slop/
89•_ZeD_•7h ago•121 comments

Java 27

https://mail.openjdk.org/archives/list/announce@openjdk.org/thread/ORGGLMN75HFEWP7YL3ZLGHLYHVIBJDYT/
258•mkurz•4h ago•201 comments

What we have learned at OpenShell applying formal methods to control AI agents

https://nvidia.github.io/OpenShell-Research/dev-notes/posts/2026-09-10-learning-formal-methods-ag...
15•alexwatson405•3h ago•7 comments

Show HN: Ordewell – turn one goal into an ordered plan of coding-agent tasks

https://github.com/ordewell/ordewell
32•ac-ciano•4h ago•28 comments