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•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?

Claude for Small Business

https://www.anthropic.com/news/claude-for-small-business
293•neilfrndes•7h ago•229 comments

Scorched Earth 2000 – Web

http://www.scorch2000.com/web/
283•meshko•10h ago•101 comments

Linux gaming is faster because Windows APIs are becoming Linux kernel features

https://www.xda-developers.com/linux-gaming-is-getting-faster-because-windows-apis-are-becoming-l...
770•haunter•3d ago•494 comments

Show HN: Running the second public ODoH relay

https://numa.rs/blog/posts/odoh-anonymous-dns-without-an-account.html
11•rdme•38m ago•0 comments

Classic 7 is a Windows 10 LTSC mod to look 1:1 to Windows 7

https://classic7.lol/
78•jandeboevrie•4h ago•67 comments

Setting up a free *.city.state.us locality domain (2025)

https://fredchan.org/blog/locality-domains-guide/
569•speckx•20h ago•177 comments

Technical Dimensions of Live Feedback in Programming Systems

https://joshuahhh.com/dims-of-feedback/
15•tobr•3d ago•1 comments

Leaving the Physical World

https://www.eff.org/pages/leaving-physical-world
19•andsoitis•3d ago•2 comments

MacBook Neo Deep Dive: Benchmarks, Wafer Economics, and the 8GB Gamble

https://www.jdhodges.com/blog/macbook-neo-benchmarks-analysis/
239•tosh•16h ago•269 comments

A History of IDEs at Google

https://laurent.le-brun.eu/blog/a-history-of-ides-at-google
383•laurentlb•5d ago•251 comments

The Emacsification of Software

https://sockpuppet.org/blog/2026/05/12/emacsification/
315•rdslw•1d ago•207 comments

Saying Goodbye to one line of APL

https://homewithinnowhere.com/posts/2026-05-10-one-line.html#fnref1
6•tosh•3d ago•1 comments

A Claude Code and Codex Skill for Deliberate Skill Development

https://github.com/DrCatHicks/learning-opportunities
64•cdrnsf•8h ago•14 comments

Chess puzzle I found in my dad's old book

https://ardoedo.it/kempelen/
167•Eswo•2d ago•45 comments

Show HN: Nibble

https://github.com/glouw/nibble
64•glouwbug•9h ago•11 comments

Extraordinary Ordinals

https://text.marvinborner.de/2026-04-09-17.html
28•marvinborner•2d ago•11 comments

Twin brothers wipe 96 government databases minutes after being fired

https://arstechnica.com/tech-policy/2026/05/drop-database-what-not-to-do-after-losing-an-it-job/
451•jnord•1d ago•354 comments

Avoiding and reducing microplastic false positives from dry glove contact

https://pubs.rsc.org/en/content/articlelanding/2026/ay/d5ay01801c
58•efavdb•10h ago•10 comments

Cisco workforce reductions

https://blogs.cisco.com/news/our-path-forward
218•ahmedomran8•9h ago•213 comments

delta time

https://www.deltatime.life/
61•mxfh•10h ago•39 comments

Show HN: Needle: We Distilled Gemini Tool Calling into a 26M Model

https://github.com/cactus-compute/needle
680•HenryNdubuaku•1d ago•197 comments

The US is winning the AI race where it matters most: commercialization

https://avkcode.github.io/blog/us-winning-ai-race.html
205•akrylov•21h ago•562 comments

The Deathbed Notes of Henry James (1968)

https://www.theatlantic.com/past/docs/unbound/flashbks/james/jnote.htm
11•Hooke•1d ago•0 comments

Xs of Y – roguelike that names itself every run. Written in 4kLoC

https://github.com/nooga/xsofy
192•andsoitis•4d ago•79 comments

Heritability of human life span is ~50% when heritability is redefined

https://dynomight.net/lifespan/
105•surprisetalk•1d ago•60 comments

How can Apple deal with the memory shortage?

https://asymco.com/2026/05/11/the-great-memory-panic-of-2026/
104•tambourine_man•2d ago•110 comments

Launch HN: Ardent (YC P26) – Postgres sandboxes in seconds with zero migration

https://www.tryardent.com/
91•vc289•18h ago•36 comments

Reverting the incremental GC in Python 3.14 and 3.15

https://discuss.python.org/t/reverting-the-incremental-gc-in-python-3-14-and-3-15/107014
240•curiousgal•4d ago•99 comments

Princeton mandates proctoring for in-person exams, upending 133 year precedent

https://www.dailyprincetonian.com/article/2026/05/princeton-news-adpol-proctoring-in-person-exami...
334•bookofjoe•15h ago•503 comments

Microsoft BitLocker – YellowKey zero-day exploit

https://www.tomshardware.com/tech-industry/cyber-security/microsoft-bitlocker-protected-drives-ca...
180•cookiengineer•8h ago•101 comments