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?

Google releases Gemma 4 open models

https://deepmind.google/models/gemma/gemma-4/
921•jeffmcjunkin•6h ago•281 comments

Tailscale's new macOS home

https://tailscale.com/blog/macos-notch-escape
221•tosh•3h ago•102 comments

Cursor 3

https://cursor.com/blog/cursor-3
202•adamfeldman•4h ago•163 comments

George Harry Goble has died

https://www.legacy.com/us/obituaries/wlfi/name/george-goble-obituary?id=61144779
80•finaard•3h ago•17 comments

Artemis II's toilet is a moon mission milestone

https://www.scientificamerican.com/article/artemis-iis-toilet-is-a-moon-mission-milestone/
53•1659447091•19h ago•17 comments

ParadeDB (YC S23) Is Hiring Database Internal Engineers (Rust)

https://paradedb.notion.site/
1•philippemnoel•2m ago

Qwen3.6-Plus: Towards real world agents

https://qwen.ai/blog?id=qwen3.6
378•pretext•7h ago•131 comments

Good ideas do not need lots of lies in order to gain public acceptance (2008)

https://blog.danieldavies.com/2004/05/d-squared-digest-one-minute-mba.html
90•sedev•4h ago•31 comments

Decisions that eroded trust in Azure – by a former Azure Core engineer

https://isolveproblems.substack.com/p/how-microsoft-vaporized-a-trillion
92•axelriet•6h ago•16 comments

Lemonade by AMD: a fast and open source local LLM server using GPU and NPU

https://lemonade-server.ai
395•AbuAssar•11h ago•93 comments

JSON Canvas Spec

https://jsoncanvas.org/spec/1.0/
76•tobr•3d ago•27 comments

LinkedIn is searching your browser extensions

https://browsergate.eu/
1481•digitalWestie•9h ago•654 comments

Significant progress made on Xbox 360 recompilation

https://readonlymemo.com/rexglue-xbox-360-recompilation-interview/
48•tetrisgm•4d ago•13 comments

Australia to crack down on gambling ads after years of criticism

https://www.bbc.com/news/articles/c62492e925lo
34•gostsamo•3h ago•18 comments

OpenAI Acquires TBPN

https://openai.com/index/openai-acquires-tbpn/
110•surprisetalk•4h ago•83 comments

Magic the Gathering Deck Shuffler

https://mtg.jessitron.honeydemo.io/
23•mooreds•3d ago•10 comments

Inside Nepal's Fake Rescue Racket

https://kathmandupost.com/money/2026/03/27/inside-nepal-s-fake-rescue-racket
236•lode•10h ago•104 comments

Artemis computer running two instances of MS outlook; they can't figure out why

https://bsky.app/profile/nikigrayson.com/post/3miik2wzosk25
242•mooreds•7h ago•182 comments

Significant Raise of Reports

https://lwn.net/Articles/1065620/
261•stratos123•13h ago•137 comments

Show HN: A P2P messenger with dual network modes (Fast and Tor)

https://github.com/Realman78/Kiyeovo/
21•Realman78•6h ago•3 comments

Foxing aspires to be an eBPF-powered replication engine for Linux filesystems

https://codeberg.org/aenertia/foxing
22•tanelpoder•3d ago•4 comments

IBM Announces Strategic Collaboration with Arm

https://newsroom.ibm.com/2026-04-02-ibm-announces-strategic-collaboration-with-arm-to-shape-the-f...
253•bonzini•13h ago•166 comments

'Backrooms' and the Rise of the Institutional Gothic

https://thereader.mitpress.mit.edu/backrooms-and-the-rise-of-the-institutional-gothic/
154•anarbadalov•8h ago•70 comments

Amazon is adding a fuel surcharge to fees it collects from third-party sellers

https://www.cnbc.com/2026/04/02/amazon-add-3point5percent-fuel-and-logistics-surcharge-for-seller...
103•lehi•3h ago•45 comments

Sweden goes back to basics, swapping screens for books in the classroom

https://undark.org/2026/04/01/sweden-schools-books/
692•novaRom•11h ago•364 comments

Artemis II will use laser beams to live-stream 4K moon footage at 260 Mbps

https://www.tomshardware.com/networking/artemis-ii-will-use-laser-beams-to-live-stream-4k-moon-fo...
296•speckx•7h ago•134 comments

Hugo's New CSS Powers

https://www.brycewray.com/posts/2026/04/hugos-new-css-powers/
30•speckx•3h ago•6 comments

Yggdrasil Network

https://yggdrasil-network.github.io/
73•Velocifyer•4h ago•28 comments

Renewables reached nearly 50% of global electricity capacity last year

https://www.theregister.com/2026/04/01/renewables_generated_nearly_half_global_power/
227•Growtika•6h ago•101 comments

Iran Says It Hit Oracle Facilities in UAE

https://gizmodo.com/iran-says-it-hit-oracle-facilities-in-uae-2000741785
25•Betelbuddy•44m ago•3 comments