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?

OpenAI and Hugging Face address security incident during model evaluation

https://openai.com/index/hugging-face-model-evaluation-security-incident/
895•mfiguiere•9h ago•633 comments

LG to ban residential proxies from smart TV apps

https://krebsonsecurity.com/2026/07/lg-to-ban-residential-proxies-from-smart-tv-apps/
132•DemiGuru•3h ago•94 comments

Kimi K3 Is Competitive with Fable; Kimi K3 and Fable Is SoTA

https://fireworks.ai/blog/kimik3-fable
439•piotrgrabowski•6h ago•265 comments

FreeInk: Open ecosystem for e-readers

https://freeink.org/
472•FriedPickles•10h ago•112 comments

Advertise in ChatGPT

https://ads.openai.com/
543•montecarl•10h ago•408 comments

A digestion of the Jacobian conjecture counterexample

https://terrytao.wordpress.com/2026/07/21/a-digestion-of-the-jacobian-conjecture-counterexample/
222•jeremyscanvic•8h ago•74 comments

Gemini 3.6 Flash, 3.5 Flash-Lite, and 3.5 Flash Cyber

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-6-flash-3-5-flas...
644•logickkk1•14h ago•511 comments

Ten Steps Towards Happiness (2015)

http://hintjens.com/blog:99
74•emerongi•4h ago•18 comments

Judge approves $1.5B Anthropic settlement for pirated books used to train Claude

https://apnews.com/article/ai-anthropic-copyright-settlement-claude-books-bartz-74b140444023898ae...
220•BeetleB•10h ago•160 comments

Late.sh – a command-line Clubhouse for computer people

https://late.sh/
42•itherseed•2h ago•10 comments

"Drawing" the Mona Lisa with GPT-5.6, Claude, Gemini, and Grok

https://www.tryai.dev/blog/ai-drawing-arena-colored-pencils-claude-gpt-grok
151•hershyb_•8h ago•52 comments

Long presumed dead, a thriving coral reef is discovered in West Africa

https://e360.yale.edu/digest/benin-coral-reef
325•speckx•13h ago•69 comments

Jack Dorsey launches Buzz to combine team chat, AI agents and Git hosting

https://runtimewire.com/article/jack-dorsey-block-buzz-team-chat-ai-agents-git
282•ryanmerket•12h ago•239 comments

Apple defeats liability for not scanning iCloud for CSAM

https://blog.ericgoldman.org/archives/2026/07/apple-defeats-liability-for-not-scanning-icloud-for...
386•speckx•14h ago•357 comments

It's a shame what's happened to radio

https://blog.jimgrey.net/2026/07/21/its-a-shame-whats-happened-to-radio-3/
65•sonicrocketman•5h ago•54 comments

Map of the world's great castles and fortresses

https://thecastlemap.com/
218•marklit•13h ago•149 comments

Gemini last models: temperature, top_p, and top_k are deprecated and ignored

https://ai.google.dev/gemini-api/docs/latest-model
61•greatgib•7h ago•17 comments

Laguna S 2.1

https://poolside.ai/blog/introducing-laguna-s-2-1
269•rexledesma•12h ago•50 comments

'VPNs are lawful technical tools,' says EU Court in landmark copyright ruling

https://www.techradar.com/vpn/vpn-privacy-security/vpns-are-lawful-technical-tools-says-eu-court-...
447•healsdata•9h ago•77 comments

Pico W firmware creates driverless USB WiFi bridge (Layer-2)

https://www.cnx-software.com/2026/07/16/pico-usb-wifi-converts-the-raspberry-pi-pico-w-into-a-dri...
25•whiteblossom•3d ago•2 comments

The Birth of Prolog (1996)

https://dl.acm.org/doi/10.1145/234286.1057820
81•Jtsummers•4d ago•5 comments

PCjs Machines

https://www.pcjs.org/
203•naves•15h ago•26 comments

My USB Drive Has a Hidden Encrypted Vault

https://rootkitlabs.com/2026/06/22/I%27m-Building-a-Secure-USB-Drive/
201•machinehum•1d ago•110 comments

Show HN: Justif – Knuth-Plass justification and microtypography for the web

https://justif.lyall.co/
121•lyall•4d ago•16 comments

Apple Private Cloud Compute SoC 3 audit reports

https://support.apple.com/guide/certifications/apple-private-cloud-compute-soc-3-audit-apc95a31b9...
119•throwfaraway4•11h ago•49 comments

A flaky test exposed a Redis client use-after-free

https://buildkite.engineering/how-a-flaky-test-exposed-a-redis-use-after-free/
36•DrNemski•4h ago•11 comments

The Miso That Went to Space

https://ambrook.com/offrange/culture/miso-in-space
12•surprisetalk•4d ago•1 comments

Roblox Officially Supports GrapheneOS

https://en.help.roblox.com/hc/en-us/articles/49648939984916-Android-Remote-Attestation
149•Cider9986•12h ago•28 comments

Show HN: Computable – Buy, sell, and redeem GPU for the exact weeks you want

https://www.getcomputable.com/
36•yuansong98•7h ago•22 comments

Bloomy (YC S26) is hiring a founding engineer

1•alexsouthmayd•12h ago