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?

EEG shows brain can simultaneous encode two speech streams

https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.3003876
126•giuliomagnifico•5h ago•69 comments

Kimi K3: Open Frontier Intelligence

https://www.kimi.com/blog/kimi-k3
1690•vincent_s•20h ago•991 comments

Pebble Mega Update – July 2026

https://repebble.com/blog/pebble-mega-update-july-2026
135•crazysaem•7h ago•55 comments

How Has Roman Concrete Lasted for Millennia? 1,900-Year-Old Latrine Offers Clues

https://www.smithsonianmag.com/smart-news/how-has-roman-concrete-lasted-for-millennia-a-1900-year...
142•divbzero•7h ago•106 comments

SQLite Is All You Need

https://www.dbpro.app/blog/sqlite-is-all-you-need
23•upmostly•2d ago•14 comments

Microsoft Comic Chat is now open source

https://opensource.microsoft.com/blog/2026/07/16/microsoft-comic-chat-is-now-open-source/
700•jervant•19h ago•154 comments

Decoy Font

https://www.mixfont.com/experiments/decoy-font
574•ray__•19h ago•136 comments

An Engineer's Guide to USB Typе-С (2024)

https://www.ti.com/lit/eb/slyy228/slyy228.pdf?ts=1759892558029
187•gregsadetsky•6d ago•18 comments

LM Studio Bionic: the AI agent for open models

https://lmstudio.ai/blog/introducing-lm-studio-bionic
265•minimaxir•15h ago•95 comments

Solod: Go can be a better C

https://solod.dev
143•koeng•3d ago•81 comments

$100 AI Music Video: Claude Fable 5 vs. GPT-5.6 Sol

https://www.tryai.dev/blog/ai-music-video-arena-claude-vs-gpt-5.6
292•hershyb_•15h ago•389 comments

Starlink from 1984

https://nemanjatrifunovic.substack.com/p/starlink-from-1984
40•ingve•5d ago•15 comments

NotebookLM is now Gemini Notebook

https://blog.google/innovation-and-ai/products/gemini-notebook/notebooklm-gemini-notebook/
319•xnx•19h ago•160 comments

The Little Book of Reinforcement Learning

https://github.com/alxndrTL/little-book-rl/
148•mustaphah•12h ago•18 comments

Camera Chase Vehicle

https://transistor-man.com/gimbal_camera_rover.html
24•geerlingguy•1w ago•1 comments

I Owe My Life to the Commodore 64

https://www.goto10retro.com/p/i-owe-my-life-to-the-commodore-64
24•ingve•1h ago•11 comments

Immersive Linear Algebra Book with Interactive Figures (2015)

https://immersivemath.com/ila/
238•srean•19h ago•27 comments

Detecting LLM-Generated Texts with “Classical” Machine Learning

https://blog.lyc8503.net/en/post/llm-classifier/
205•uneven9434•18h ago•148 comments

Old Icons

https://leancrew.com/all-this/2026/07/old-icons/
66•zdw•5d ago•16 comments

In Praise of Exhaustive Destructuring

https://antoine.vandecreme.net/blog/exhaustive-destructuring-praise/
23•avandecreme•5d ago•5 comments

Helium escaping from atmosphere of nearby rocky exoplanet in a habitable zone

https://www.science.org/doi/10.1126/science.aea9708
115•anyonecancode•15h ago•35 comments

Mathematics of Data Science

https://arxiv.org/abs/2607.11938
172•Anon84•14h ago•10 comments

CD sales growth outpaced vinyl in the first half of 2026

https://consequence.net/2026/07/the-cd-revival-is-getting-hard-to-ignore/
120•speckx•18h ago•130 comments

'Likweli': A new monkey species discovered in the Congo Basin

https://news.yale.edu/2026/07/15/meet-likweli-new-monkey-species-discovered-congo-basin
86•gmays•13h ago•20 comments

The LLM Critics Are Right. I Use LLMs Anyway

https://www.theocharis.dev/blog/llm-critics-are-right-i-use-llms-anyway/
239•JeremyTheo•23h ago•246 comments

The human-in-the-loop is tired

https://pydantic.dev/articles/the-human-in-the-loop-is-tired
240•haritha1313•11h ago•129 comments

Show HN: Clx – Compile Lua to Native Executables Through C++20

https://github.com/samyeyo/clx
122•_samt_•5d ago•24 comments

How to Train a Gen AI Kick Drum Model on Your Old Linux Desktop with 6GB VRAM

https://www.zhinit.dev/blog/training-a-kick-drum-diffusion-model
140•zhinit•20h ago•68 comments

Just got an AWS billing alert projecting my monthly cost at $140B

12•mirzap•49m ago•4 comments

UIUC AI Teaching Assistant

https://github.com/Center-for-AI-Innovation/ai-teaching-assistant-uiuc
21•teleforce•9h ago•0 comments