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•11mo ago
Code at https://github.com/wiwa/blog-code/

Comments

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

iNaturalist

https://www.inaturalist.org/
109•bookofjoe•1h ago•32 comments

Show HN: I built a frontpage for personal blogs

https://text.blogosphere.app/
469•ramkarthikk•6h ago•137 comments

We replaced RAG with a virtual filesystem for our AI documentation assistant

https://www.mintlify.com/blog/how-we-built-a-virtual-filesystem-for-our-assistant
54•denssumesh•1d ago•36 comments

Samsung Magician disk utility takes 18 steps and two reboots to uninstall

https://chalmovsky.com/2026/03/29/samsung-magician.html
271•chalmovsky•4d ago•144 comments

The Technocracy Movement of the 1930s

https://donotresearch.substack.com/p/welcome-to-the-technocracy
37•lazydogbrownfox•16h ago•9 comments

Go on Embedded Systems and WebAssembly

https://tinygo.org/
26•uticus•1h ago•1 comments

Show HN: An evidence-rated encyclopedia of peptides

https://www.whatthepeptide.org/
7•uelbably•43m ago•1 comments

Understanding young news audiences at a time of rapid change

https://reutersinstitute.politics.ox.ac.uk/understanding-young-news-audiences-time-rapid-change
27•giuliomagnifico•5d ago•20 comments

A School District Tried to Help Train Waymos to Stop for School Buses

https://www.wired.com/story/a-school-district-tried-to-help-train-waymos-to-stop-for-school-buses...
13•phlummox•5d ago•3 comments

Show HN: TurboQuant for vector search – 2-4 bit compression

https://github.com/RyanCodrai/py-turboquant
43•justsomeguy1996•5d ago•2 comments

April 2026 TLDR Setup for Ollama and Gemma 4 26B on a Mac mini

https://gist.github.com/greenstevester/fc49b4e60a4fef9effc79066c1033ae5
232•greenstevester•9h ago•98 comments

Big-Endian Testing with QEMU

https://www.hanshq.net/big-endian-qemu.html
64•jandeboevrie•5h ago•53 comments

A Recipe for Steganogravy

https://theo.lol/python/ai/steganography/seo/recipes/2026/03/27/a-recipe-for-steganogravy.html
101•tbrockman•5d ago•24 comments

Build your own Dial-up ISP with a Raspberry Pi

https://www.jeffgeerling.com/blog/2026/build-your-own-dial-up-isp-with-a-raspberry-pi/
31•arjunbajaj•3h ago•8 comments

SSH certificates: the better SSH experience

https://jpmens.net/2026/04/03/ssh-certificates-the-better-ssh-experience/
145•jandeboevrie•8h ago•56 comments

Show HN: Apfel – The free AI already on your Mac

https://apfel.franzai.com
560•franze•9h ago•126 comments

If you're running OpenClaw, you probably got hacked in the last week

https://old.reddit.com/r/sysadmin/comments/1sbdw29/if_youre_running_openclaw_you_probably_got_hac...
152•kykeonaut•2h ago•89 comments

What Category Theory Teaches Us About DataFrames

https://mchav.github.io/what-category-theory-teaches-us-about-dataframes/
149•mchav•5d ago•46 comments

TDF ejects its core developers

https://meeksfamily.uk/~michael/blog/2026-04-02-tdf-ejects-core-devs.html
127•janvdberg•6h ago•83 comments

ESP32-S31: Dual-Core RISC-V SoC with Wi-Fi 6, Bluetooth 5.4, and Advanced HMI

https://www.espressif.com/en/news/ESP32_S31_Release
164•topspin•5d ago•93 comments

Solana Drift Protocol drained of $285M via fake token and governance hijack

https://anonhaven.com/en/news/drift-protocol-hack-285-million-solana/
48•anonhaven•1h ago•19 comments

F-15E jet shot down over Iran

https://www.theguardian.com/world/2026/apr/03/us-fighter-jet-confirmed-shot-down-over-iran
49•tjwds•2h ago•167 comments

Mercurial Dyson – a plan for the disassembly of planet Mercury

https://github.com/RokoMijic/MercurialDyson/blob/main/written_report.md
31•indy•1h ago•18 comments

Firm boosts H.264 streaming license fees from $100k up to staggering $4.5M

https://www.tomshardware.com/service-providers/streaming/h264-streaming-license-fees-jump-from-10...
10•MaximilianEmel•27m ago•3 comments

What we learned building 100 API integrations with OpenCode

https://nango.dev/blog/learned-building-200-api-integrations-with-opencode/
73•rguldener•3d ago•17 comments

Solar and batteries can power the world

https://nworbmot.org/blog/solar-battery-world.html
223•edent•4h ago•310 comments

NHS staff refusing to use FDP over Palantir ethical concerns

https://www.freevacy.com/news/financial-times/nhs-staff-refusing-to-use-fdp-over-palantir-ethical...
268•chrisjj•9h ago•115 comments

Category Theory Illustrated – Types

https://abuseofnotation.github.io/category-theory-illustrated/06_type/
58•boris_m•8h ago•1 comments

Intel Assured Supply Chain Product Brief

https://www.intel.com/content/www/us/en/content-details/850997/intel-assured-supply-chain-product...
46•aw-engineer•4d ago•10 comments

Google releases Gemma 4 open models

https://deepmind.google/models/gemma/gemma-4/
1690•jeffmcjunkin•1d ago•446 comments