frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Faster sorting with SIMD CUDA intrinsics (2024)

https://winwang.blog/posts/bitonic-sort/
92•winwang•9mo ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•9mo 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•9mo 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•9mo 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•9mo 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•9mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•9mo 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•9mo 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•9mo 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•9mo 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•9mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•9mo ago
What are the biggest use cases of GPU accelerated sorting?

Terence Tao, at 8 years old (1984) [pdf]

https://gwern.net/doc/iq/high/smpy/1984-clements.pdf
248•gurjeet•18h ago•104 comments

Firefox 148 Launches with AI Kill Switch Feature and More Enhancements

https://serverhost.com/blog/firefox-148-launches-with-exciting-ai-kill-switch-feature-and-more-en...
226•shaunpud•4h ago•189 comments

Show HN: enveil – hide your .env secrets from prAIng eyes

https://github.com/GreatScott/enveil
74•parkaboy•4h ago•36 comments

Diode – Build, program, and simulate hardware

https://www.withdiode.com/
31•rossant•3d ago•8 comments

I Ported Coreboot to the ThinkPad X270

https://dork.dev/posts/2026-02-20-ported-coreboot/
191•todsacerdoti•9h ago•30 comments

Blood test boosts Alzheimer's diagnosis accuracy to 94.5%, clinical study shows

https://medicalxpress.com/news/2026-02-blood-boosts-alzheimer-diagnosis-accuracy.html
246•wglb•6h ago•92 comments

The Age Verification Trap: Verifying age undermines everyone's data protection

https://spectrum.ieee.org/age-verification
1443•oldnetguy•19h ago•1105 comments

Show HN: X86CSS – An x86 CPU emulator written in CSS

https://lyra.horse/x86css/
120•rebane2001•7h ago•45 comments

Baby chicks pass the bouba-kiki test, challenging a theory of language evolution

https://www.scientificamerican.com/article/baby-chicks-pass-the-bouba-kiki-test-challenging-a-the...
75•beardyw•4d ago•18 comments

Show HN: Steerling-8B, a language model that can explain any token it generates

https://www.guidelabs.ai/post/steerling-8b-base-model-release/
157•adebayoj•9h ago•37 comments

Making Wolfram Tech Available as a Foundation Tool for LLM Systems

https://writings.stephenwolfram.com/2026/02/making-wolfram-tech-available-as-a-foundation-tool-fo...
167•surprisetalk•11h ago•86 comments

Unsung heroes: Flickr's URLs scheme

https://unsung.aresluna.org/unsung-heroes-flickrs-urls-scheme/
61•onli•2d ago•18 comments

UNIX99, a UNIX-like OS for the TI-99/4A (2025)

https://forums.atariage.com/topic/380883-unix99-a-unix-like-os-for-the-ti-994a/
174•marcodiego•13h ago•53 comments

“Car Wash” test with 53 models

https://opper.ai/blog/car-wash-test
223•felix089•13h ago•262 comments

Intel XeSS 3: expanded support for Core Ultra/Core Ultra 2 and Arc A, B series

https://www.intel.com/content/www/us/en/download/785597/intel-arc-graphics-windows.html
28•nateb2022•5h ago•17 comments

A simple web we own

https://rsdoiel.github.io/blog/2026/02/21/a_simple_web_we_own.html
235•speckx•17h ago•156 comments

Genetic underpinnings of chills from art and music

https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1012002
23•coloneltcb•1d ago•5 comments

Show HN: PgDog – Scale Postgres without changing the app

https://github.com/pgdogdev/pgdog
259•levkk•18h ago•51 comments

Ladybird adopts Rust, with help from AI

https://ladybird.org/posts/adopting-rust/
1169•adius•22h ago•645 comments

AI-generated replies really are a scourge these days

https://twitter.com/simonw/status/2025909963445707171
5•da_grift_shift•13m ago•1 comments

What it means that Ubuntu is using Rust

https://smallcultfollowing.com/babysteps/blog/2026/02/23/ubuntu-rustnation/
142•zdw•16h ago•161 comments

FreeBSD doesn't have Wi-Fi driver for my old MacBook, so AI built one for me

https://vladimir.varank.in/notes/2026/02/freebsd-brcmfmac/
360•varankinv•12h ago•293 comments

Typed Assembly Language (2000)

https://www.cs.cornell.edu/talc/
35•luu•3d ago•14 comments

Show HN: Babyshark – Wireshark made easy (terminal UI for PCAPs)

https://github.com/vignesh07/babyshark
116•eigen-vector•13h ago•43 comments

Writing code is cheap now

https://simonwillison.net/guides/agentic-engineering-patterns/code-is-cheap/
173•swolpers•16h ago•237 comments

Graph Topology and Battle Royale Mechanics

https://blog.lukesalamone.com/posts/beam-search-graph-pruning/
4•salamo•2d ago•0 comments

Shatner is making an album with 35 metal icons

https://www.guitarworld.com/artists/guitarists/william-shatner-announces-all-star-metal-album
182•mhb•9h ago•81 comments

Show HN: Cellarium: A Playground for Cellular Automata

https://github.com/andrewosh/cellarium
11•andrewosh•3d ago•0 comments

SIM (YC X25) Is Hiring the Best Engineers in San Francisco

https://www.ycombinator.com/companies/sim/jobs/Rj8TVRM-software-engineer-platform
1•waleedlatif1•12h ago

Iowa farmers are leading the fight for repair

https://www.ifixit.com/News/115722/iowa-farmers-are-leading-the-fight-for-repair
124•gnabgib•8h ago•33 comments