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

Comments

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

Internet Archive's Storage

https://blog.dshr.org/2026/01/internet-archives-storage.html
47•zdw•3d ago•6 comments

Unrolling the Codex agent loop

https://openai.com/index/unrolling-the-codex-agent-loop/
274•tosh•9h ago•135 comments

Proof of Corn

https://proofofcorn.com/
341•rocauc•12h ago•251 comments

Some C habits I employ for the modern day

https://www.unix.dog/~yosh/blog/c-habits-for-me.html
116•signa11•4d ago•36 comments

New YC homepage

https://www.ycombinator.com/
218•sarreph•12h ago•109 comments

Comma openpilot – Open source driver-assistance

https://comma.ai
217•JumpCrisscross•5h ago•118 comments

Losing 1½ Million Lines of Go

https://www.tbray.org/ongoing/When/202x/2026/01/14/Unicode-Properties
65•moks•4d ago•6 comments

Gas Town's agent patterns, design bottlenecks, and vibecoding at scale

https://maggieappleton.com/gastown
290•pavel_lishin•13h ago•311 comments

Banned C++ features in Chromium

https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md
135•szmarczak•9h ago•110 comments

Microsoft gave FBI set of BitLocker encryption keys to unlock suspects' laptops

https://techcrunch.com/2026/01/23/microsoft-gave-fbi-a-set-of-bitlocker-encryption-keys-to-unlock...
754•bookofjoe•12h ago•496 comments

Extracting verified C++ from the Rocq theorem prover at Bloomberg

https://bloomberg.github.io/crane/
10•clarus•3d ago•1 comments

SEC obtains final consent judgments against former FTX and Alameda executives

https://www.sec.gov/enforcement-litigation/litigation-releases/lr-26450
80•sizzle•3h ago•52 comments

Ask HN: What's the current best local/open speech-to-speech setup?

108•dsrtslnd23•19h ago•22 comments

Route leak incident on January 22, 2026

https://blog.cloudflare.com/route-leak-incident-january-22-2026/
135•nomaxx117•12h ago•37 comments

Mental Models (2018)

https://fs.blog/mental-models/
70•hahahacorn•9h ago•11 comments

Booting from a vinyl record (2020)

https://boginjr.com/it/sw/dev/vinyl-boot/
294•yesturi•19h ago•108 comments

Noora Health (YC W14) Is Hiring AI/ML Engineer

https://www.ycombinator.com/companies/noora-health/jobs/2B4RxLG-ai-ml-engineer
1•edithaelliott•5h ago

KORG phase8 – Acoustic Synthesizer

https://www.korg.com/us/products/dj/phase8/
215•bpierre•15h ago•95 comments

Air traffic control: the IBM 9020

https://computer.rip/2026-01-17-air-traffic-control-9020.html
16•pinewurst•5d ago•1 comments

Proton Spam and the AI Consent Problem

https://dbushell.com/2026/01/22/proton-spam/
493•dbushell•23h ago•350 comments

The tech monoculture is finally breaking

http://www.jasonwillems.com/technology/2025/12/17/Tech-Is-Fun-Again/
161•at1as•14h ago•209 comments

Wilson Lin on FastRender: a browser built by parallel agents

https://simonwillison.net/2026/Jan/23/fastrender/
39•lumpa•7h ago•9 comments

Show HN: Whosthere: A LAN discovery tool with a modern TUI, written in Go

https://github.com/ramonvermeulen/whosthere
224•rvermeulen98•18h ago•79 comments

Gold fever, cold, and the true adventures of Jack London in the wild

https://www.smithsonianmag.com/history/gold-fever-deadly-cold-and-amazing-true-adventures-jack-lo...
51•janandonly•5d ago•15 comments

Nobody likes lag: How to make low-latency dev sandboxes

https://www.compyle.ai/blog/nobody-likes-lag/
71•mnazzaro•12h ago•35 comments

Waypoint-1: Real-Time Interactive Video Diffusion from Overworld

https://huggingface.co/blog/waypoint-1
68•avaer•15h ago•17 comments

Floating-Point Printing and Parsing Can Be Simple and Fast

https://research.swtch.com/fp
104•chmaynard•4d ago•11 comments

Killing the ISP Appliance: An eBPF/XDP Approach to Distributed BNG

https://markgascoyne.co.uk/posts/ebpf-bng/
73•chaz6•12h ago•21 comments

Notes on the Intel 8086 processor's arithmetic-logic unit

https://www.righto.com/2026/01/notes-on-intel-8086-processors.html
90•elpocko•12h ago•11 comments

Show HN: Text-to-video model from scratch (2 brothers, 2 years, 2B params)

https://huggingface.co/collections/Linum-AI/linum-v2-2b-text-to-video
134•schopra909•1d ago•23 comments