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?

Qwen 3.8 27B

https://huggingface.co/Qwen/Qwen3.8-27B-FP8
641•erdaltoprak•5h ago•419 comments

Seven books I keep close because I love them

https://blog.plover.com/2026/08/02/
230•surprisetalk•5h ago•97 comments

RustDesk now supports true unattended remote access on Wayland

https://rustdesk.com/blog/unattended-remote-access-wayland/
150•rustdesk•4h ago•58 comments

Why does Opus 5 feel worse to work with?

https://mun-logadan.github.io/why-does-opus-5-feel-worse/
609•numeri•10h ago•571 comments

GLM-5.3: Frontier coding with emergent cyber capabilities

https://z.ai/blog/glm-5.3
982•pella•15h ago•491 comments

Google is making private AI practical with homomorphic encryption

https://blog.google/security/how-google-is-making-private-ai-practical-with-homomorphic-encryption/
164•u1hcw9nx•5h ago•110 comments

Anthropic Risk August 2026 [pdf]

https://www-cdn.anthropic.com/f61d49fa5596956a5dec75fea0e973bf6a6a8378/Redacted%20Risk%20Report%2...
21•artninja1988•1h ago•3 comments

Introducing Toast 1

https://www.mixedbread.com/blog/toast-1
141•mplappert•5h ago•42 comments

AI by Hand

https://www.byhand.ai/
99•sans_souse•4h ago•10 comments

Show HN: Ember – Redshift safe color palettes

https://github.com/carpdiem/ember
13•carpdiem•5d ago•0 comments

Ultraviolet Bird Photography

https://uvbirds.com/
66•EndXA•1w ago•12 comments

I turned my RSS feeds into an e-ink newspaper to stop reading on my phone

https://heyjonny.dev/posts/rss-to-eink-newspaper/
94•speckx•6h ago•39 comments

Show HN: Mole – Deep research agent for your terminal

https://github.com/lajosdeme/mole
19•lajosdeme•1h ago•5 comments

New Lower and Upper Bounds for the Grothendieck Constant

https://arxiv.org/abs/2608.11158
7•surprisetalk•1h ago•1 comments

Open WireGuard Endpoints

https://proxylity.com/articles/now-available-open-wireguard-endpoints-and-async-lambda.html
13•mlhpdx•1h ago•0 comments

Every Fucking Website (2020)

https://lxe.github.io/everywebsite/
647•doubletwoyou•6h ago•371 comments

Turbo Pascal on CP/M, MSX-DOS and MS-DOS – Pascal for Small Machines

http://pascal.hansotten.com/delphi/turbo-pascal-on-cpm-msx-dos-and-ms-dos/
38•rbanffy•2d ago•9 comments

Show HN: LuaCAD – Parametric CAD Scripted in Lua

https://luacad.ad-si.com
50•adius•4h ago•12 comments

Every exterior shot in The Taking of Pelham 123

https://iafisher.com/2026/07/pelham-123
4•evakhoury•32m ago•0 comments

Maximizing the value of your Claude Code sessions

https://claude.com/blog/maximizing-the-value-of-your-claude-code-sessions
86•twapi•4h ago•61 comments

DeepSeek peak/off-peak pricing update

https://api-docs.deepseek.com/news/news260813/
230•fagnerbrack•10h ago•122 comments

Don't classify, hallucinate

https://softwaredoug.com/blog/2026/08/10/hypothetical-classifications
193•softwaredoug•3d ago•80 comments

Jason Arday, ex-Cambridge professor at centre of plagiarism row, found dead

https://www.bbc.com/news/articles/c1j1ye6n30no
41•artninja1988•51m ago•24 comments

CEO who fired 900 people on Zoom just before Christmas wants his job back

https://www.cnn.com/2026/08/14/business/vishal-garg-better-ceo
27•pseudolus•1h ago•4 comments

Forbidden City Cabbage

https://www.cnn.com/2025/11/10/style/jadeite-cabbage-taiwan-forbidden-city-curio-hnk-intl
41•dude250711•2d ago•6 comments

A Contract-Grade Verifier for LLM-Generated GPU Kernels

https://arxiv.org/abs/2608.12700
20•Jimmc414•3h ago•0 comments

France's top court blocks social media ban for under-15s

https://www.reuters.com/world/frances-top-court-rules-social-media-ban-curtails-freedom-expressio...
169•BlueBerry2001•4h ago•112 comments

Moving integer division to floating-point is trivial

http://marc-b-reynolds.github.io/math/2026/08/10/IntDivByFP.html
19•matt_d•3d ago•9 comments

The TEMU-Fication of Software, Digital Goods and Services

https://xn--gckvb8fzb.com/the-temu-fication-of-software-digital-goods-services/
110•surprisetalk•8h ago•79 comments

What You Gain by Building Your Own Game Engine

https://eliasfarhan.ch/gamedev/cpp/2026/08/14/srnative-01-why-a-custom-engine.html
4•kwakwa_cat•1h ago•0 comments