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?

GPT-6 Astra

https://openai.com/index/gpt-6-astra/
1746•kibae•14h ago•1537 comments

.name Termination

https://neil.fraser.name/news/2026/09/03/
1766•pavel_lishin•17h ago•442 comments

Qwen 3.8 27B available on Cerebras at 1500 tokens/s

https://inference-docs.cerebras.ai/models/overview
545•altertable•14h ago•174 comments

Authorization terminology is a mess: Let's fix it

https://idpro.org/authorization-terminology-is-a-mess-lets-fix-it/
20•andychiare•2d ago•2 comments

The largest electric aircraft just flew [video]

https://www.youtube.com/watch?v=nM86DBOqgPM
306•feb•2d ago•220 comments

Carbon-aware electricity pricing, measured daily on 38 grids

https://carbonawarepricing.com/
4•High-Five•28m ago•1 comments

Hackers Had a Live Feed of Every ID Verification Company Scanned for over a Year

http://www.techdirt.com/2026/09/03/hackers-had-a-live-feed-of-every-id-this-verification-company-...
79•beardyw•2h ago•23 comments

How an MIT research project became the Julia programming language

https://news.mit.edu/2026/how-mit-research-project-became-global-programming-language-0831
91•theanonymousone•4d ago•26 comments

Artificial beaver dams saw juvenile coho salmon survival rates go from 8% to 60%

https://www.discoverwildlife.com/animal-facts/artificial-beaver-dams-california
248•speckx•16h ago•78 comments

Project Xanadu: Even More Hindsight (2025)

https://gwern.net/xanadu
76•andsoitis•7h ago•14 comments

Porting my 1993 Amiga game to Godot, with an LLM reading the 68000 assembly

https://babyloniantwins.com/blog/porting-a-1993-amiga-game-to-godot/
288•rabahs•18h ago•87 comments

Go grandmaster Shin defeats AI KataGo with a two-stone handicap

https://www.kedglobal.com/artificial-intelligence/newsView/ked202607210007
296•gmays•1d ago•98 comments

Move in C++ without a std:move

https://andreasfertig.com/blog/2026/09/move-in-cpp-without-a-stdmove/
42•dalvrosa•2d ago•50 comments

K2 Horizon: A connected fleet of six open models

https://ifm.ai/blog/k2/
294•karimf•17h ago•97 comments

Which tools do Claude, Codex and Cursor choose? We measured 17k runs to find out

https://armature.tech/blog/which-tools-coding-agents-install
206•screm•11h ago•96 comments

GPS glitched across the US by as much as 33 feet

https://www.sciencealert.com/gps-glitched-across-the-us-by-as-much-as-33-feet-scientists-have-nev...
174•thread_id•1d ago•101 comments

Ask HN: Who is using MCP in production?

63•sukit•21h ago•81 comments

From Hookswitch to Grave

https://computer.rip/2026-06-14-hookswitch-to-grave.html
24•Sniffnoy•6h ago•2 comments

Xanadu was waiting for agents

https://zed.dev/blog/agentic-xanadu
118•nsm•2d ago•50 comments

Virtual Threads for a scripting language in Java 8 without Loom

https://jactl.io/blog/2026/08/28/jactl-virtual-threads
30•jaccomo•2d ago•3 comments

In defense of two-state theme toggles

https://joshcollinsworth.com/blog/in-defense-of-two-state-theme-toggles
7•surprisetalk•2d ago•11 comments

Show HN: Reactor Atlas

https://reactoratlas.com
23•fedecaccia•20h ago•13 comments

Any Human Ever – One life, drawn at random from all who have ever lived

https://anyhumanever.com/
572•thinkingemote•17h ago•270 comments

Unusual Suspects

https://neal.fun/unusual-suspects/
154•beeperboy95•1d ago•27 comments

Grep beats LSP? Why coding agents ignore your fancier tools

https://www.agentconnect.md/blog/grep-beat-lsp-harness/
71•kaonashi-tyc-01•5h ago•48 comments

A PCB business card with a batteryless LED, powered by the phone that taps it

https://www.kevin.md/the-business-card-that-lights-up.md/
80•thekevintang•2d ago•22 comments

The asteroid currently hitting front end web development

https://nolanlawson.com/2026/08/23/the-asteroid-currently-hitting-frontend-web-development/
151•codechicago277•13h ago•172 comments

Tasklet (YC P26) Is Hiring a Customer Success Engineer

https://tasklet.ai/careers/customer-success-engineer
1•mayop100•11h ago

GLP-1s are being linked to fewer serious infections, including TB

https://gizmodo.com/ozempic-and-other-glp-1s-are-being-linked-to-fewer-serious-infections-includi...
109•gumby•10h ago•57 comments

The browser's main thread is expensive

https://kciter.so/posts/the-expensive-main-thread/en/
403•kciter•2d ago•138 comments