frontpage.
newsnewestaskshowjobs

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 Fable 5.1 and Claude Mythos 5.1

https://www.anthropic.com/claude-fable-and-mythos-5-1
1057•denysvitali•11h ago•986 comments

True Rate of Unemployment

https://www.lisep.org/tru
89•ptrhvns•2h ago•30 comments

The Emergent Symbolic Structure of Artificial Neural Networks

https://arxiv.org/abs/2608.29530
26•schmuhblaster•1h ago•2 comments

How accurate have Ed Zitron's AI skeptic predictions been?

https://danluu.com/zitron/
557•jatins•10h ago•640 comments

WebFPGA

https://webfpga.io/
20•gurjeet•1h ago•10 comments

Fine, I'll build my own text editor

https://dbushell.com/2026/09/01/text-editor/
29•Alephinitesimal•12h ago•9 comments

FBI Probes Service Selling 153M+ Drivers Licenses

https://krebsonsecurity.com/2026/09/fbi-probes-service-selling-153m-drivers-licenses/
107•tatersolid•6h ago•35 comments

The efficient frontier of LLM inference

https://www.baseten.co/blog/the-efficient-frontier-of-llm-inference/
75•philipkiely•5h ago•19 comments

My local model setup on an M4 Pro Mac Mini

https://lws.io/blog/my-local-model-setup/
122•raybb•6h ago•60 comments

Show HN: Weedout – Safari extension that hides YouTube AI-labeled videos

https://masteranza.github.io/weedout/
92•masteranza•7h ago•31 comments

Introducing Ad Blocker for Firefox on iOS

https://blog.mozilla.org/en/firefox/ad-blocker-on-ios/
370•HieronymusBosch•15h ago•126 comments

Sonic Pi

https://sonic-pi.net/
77•Bluestein•4d ago•11 comments

The ChatGPT/Codex app bundles a full copy of LibreOffice

https://simonwillison.net/2026/Sep/1/codex-libreoffice/
317•timpera•9h ago•146 comments

Path to Astra: critical capabilities and frontier safeguards

https://openai.com/index/path-to-astra/
112•jithinraj•8h ago•50 comments

Launch HN: Nori Robotics (YC S26) – A low-cost humanoid robot for development

https://www.norirobotics.com/
127•AntonioLi•11h ago•43 comments

The creator of Jujutsu has joined ERSC

https://ersc.io/blog/martin-joins-ersc
209•steveklabnik•11h ago•153 comments

Show HN: HN Match Maker – Matching "Who Wants to Be Hired?" With "Who's Hiring?"

https://hnmatchmaker.com/
63•all2•8h ago•30 comments

Ambient CSS v3 – Blender meets CSS

https://ambientcss.vercel.app/
221•kikkupico•13h ago•69 comments

Movie Scene Map – 13,312 films, series, games, anime and manga

https://moviescenemap.com/
186•Flightmussy•12h ago•30 comments

Laurie Anderson’s next manuscript to be locked away for 88 years

https://www.theguardian.com/books/2026/aug/29/laurie-anderson-manuscript-88-years-future-library-...
28•mitchbob•3d ago•13 comments

Forgotten History of Small Nuclear Reactors (2015)

https://spectrum.ieee.org/the-forgotten-history-of-small-nuclear-reactors
18•derriz•4d ago•1 comments

Refurbishing a Tektronix TDS7104 Oscilloscope

https://tomverbeure.github.io/2026/08/23/Tektronix-TDS7104-Refurbishing.html
106•jwise0•9h ago•50 comments

Top Web Design Styles of 1993

https://contemporary-home-computing.org/prof-dr-style/
15•luu•1d ago•1 comments

Show HN: Running 104GB Qwen3.8-Flash-Next on 48GB Mac with at ~12 tok/s

https://github.com/carloslfu/slotstream
182•carloslfu•12h ago•91 comments

Building Autonomous Goal Loops That Deliver

https://jx0.ca/building-autonomous-goal-loops-that-deliver/
28•jarredkenny•3d ago•3 comments

Ask HN: Who is hiring? (September 2026)

204•whoishiring•14h ago•218 comments

Building an interactive instrument for a one-of-a-kind festival

https://benholmen.com/blog/halfmoon-chimes/
31•tjwds•4d ago•3 comments

Atlas: A World Model for Spatial Intelligence

https://www.worldlabs.ai/blog/atlas
184•johnsutor•11h ago•45 comments

Solving the Flat Cube

https://mathenchant.wordpress.com/2026/08/19/solving-the-flat-cube/
17•surprisetalk•1d ago•2 comments

Quill (YC W20) Is Hiring a Fullstack SWE

1•R_R•12h ago