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?

Gemini 3.7 Flash

https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-3-7-fl...
233•thisisauserid•1h ago•159 comments

Choose Boring Technology (2015)

https://mcfunley.com/choose-boring-technology
60•tosh•55m ago•16 comments

Mistral OCR 4.1

https://docs.mistral.ai/models/ocr-4-1
93•spelk•1h ago•23 comments

Accelerating GPT-5.6 Sol Ultrafast

https://www.cerebras.ai/blog/accelerating-gpt-5-6-sol-ultrafast-with-openai
49•pr337h4m•33m ago•6 comments

Donkey.bas is 45 Years Old – 131 line of Glory

https://donkeybas.com/
38•jkrauska•57m ago•15 comments

Spaghettifying DRAM

https://github.com/xoreaxeaxeax/skitter-creek-bath-salts
315•matt_d•4h ago•97 comments

Where did the old web go? We followed 657,607 links to find out

https://0.mk/blog/link-rot
23•tdx•54m ago•6 comments

Tocharian Online

https://lrc.la.utexas.edu/eieol/tokol/0
25•Bluestein•1h ago•1 comments

AI At Home Part 1: A Box Of Scraps

https://jdagostino.github.io/ai-pt1-box-o-scraps/index.html
30•timmmmmmay•2h ago•10 comments

Come for ENIAC, Stay for UNIVAC and Skeduflo

https://uniqueatpenn.wordpress.com/2026/08/05/come-for-eniac-stay-for-univac-and-skeduflo/
45•cainxinth•2d ago•11 comments

DeepSeek Harness developer preview

https://deepseek.com/harness/en/
444•bjin•5h ago•202 comments

How art invented humanity

https://aeon.co/essays/humans-did-not-invent-art-it-was-the-other-way-around
50•prismatic•19h ago•8 comments

Kubernetes on Oxide: How customer needs shaped our integrations

https://oxide.computer/blog/kubernetes-on-oxide
96•stevehipwell•4h ago•36 comments

Gloomberb

https://gloom.sh/
296•rbanffy•4h ago•155 comments

Ordinary abundance

https://ordinaryabundance.com/
102•yen223•5h ago•36 comments

Choosing an AI model: one prompt, 11 models, different results

https://www.netlify.com/blog/one-prompt-11-models-very-different-results/
127•toddmorey•5h ago•57 comments

From 13.5M installs to 499 active devices

https://games.lukicengineering.com/blog/2013-vs-2026/
23•boban-lukic•3d ago•7 comments

Codex in ChatGPT desktop app for Linux is now in preview

https://community.openai.com/t/codex-in-chatgpt-desktop-app-for-linux-is-now-in-preview/1390027
404•allanrbo•13h ago•279 comments

ATG (YC F25) Is Hiring Member of Technical Staff (Data Platform)

https://atg.science/careers
1•dkobran•6h ago

JDK 27 G1/Parallel/Serial GC Changes

https://tschatzl.github.io/2026/08/10/jdk27-g1-serial-parallel-gc-changes.html
12•0x54MUR41•1h ago•0 comments

GoAccess – Open-source real-time log analyzer and interactive viewer

https://goaccess.io/
16•gregsadetsky•2h ago•1 comments

I built a 500k-domain search engine for makers in a weekend for $10

https://alexmorleyfinch.github.io/marlin/history/v1/article/the_birth.html
94•dreamforever•5h ago•53 comments

Graduate student proves a quantum uncertainty principle for fractals

https://www.quantamagazine.org/graduate-student-proves-the-fractal-uncertainty-principle-20260812/
46•bookofjoe•4h ago•6 comments

Show HN: MCP Memory – Fast Agent Memory Using Google's OKF and SQLite FTS5

https://github.com/fellowgeek/mcp-memory
47•pcbmaker20•4h ago•27 comments

We eliminated 1,400 CVEs in NanoClaw's container images

https://www.echo.ai/blog/echo-xnanoclaw-under-the-hood
58•omrimaya•4h ago•39 comments

Launch HN: Bullet (YC S26) – A Faster Coding Agent

https://www.codewithbullet.com
23•adi1•10h ago•22 comments

Better Gaussian Splatting in Julia

https://pxl-th.github.io/blog/better-gs-julia/
95•pxl-th•4d ago•13 comments

I requested a copy of my data from McDonald’s loyalty program

https://www.wired.com/story/mcdonalds-built-a-515-page-dossier-on-me-it-says-ill-never-leave/
153•thehoff•4h ago•189 comments

Show HN: OJCP – an open protocol for agent-consumable job data

https://ojcp.dev/
15•fraywing•1d ago•2 comments

Deutsche Bank becomes first foreign yuan clearing bank in Europe

https://tradersunion.com/news/central-banks/show/2973571-deutsche-bank-becomes/
340•Markoff•6h ago•372 comments