frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Faster sorting with SIMD CUDA intrinsics (2024)

https://winwang.blog/posts/bitonic-sort/
92•winwang•9mo ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•9mo 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•9mo 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•9mo 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•9mo 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•9mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•9mo 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•9mo 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•9mo 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•9mo 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•9mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•9mo ago
What are the biggest use cases of GPU accelerated sorting?

Cognitive Debt: When Velocity Exceeds Comprehension

https://www.rockoder.com/beyondthecode/cognitive-debt-when-velocity-exceeds-comprehension/
197•pagade•2h ago•79 comments

Obsidian Sync now has a headless client

https://help.obsidian.md/sync/headless
94•adilmoujahid•1h ago•32 comments

Woxi: Wolfram Mathematica Reimplementation in Rust

https://github.com/ad-si/Woxi
143•adamnemecek•2d ago•56 comments

Verified Spec-Driven Development (VSDD)

https://gist.github.com/dollspace-gay/d8d3bc3ecf4188df049d7a4726bb2a00
19•todsacerdoti•57m ago•6 comments

New evidence that Cantor plagiarized Dedekind

https://www.quantamagazine.org/the-man-who-stole-infinity-20260225/
25•rbanffy•3d ago•6 comments

Addressing Antigravity Bans and Reinstating Access

https://github.com/google-gemini/gemini-cli/discussions/20632
110•RyanShook•4h ago•91 comments

Ghosts'n Goblins – "Worse danger is ahead"

https://superchartisland.com/ghostsn-goblins/
16•elvis70•2d ago•3 comments

Show HN: SQLite for Rivet Actors – one database per agent, tenant, or document

https://github.com/rivet-dev/rivet
13•NathanFlurry•1h ago•2 comments

We Will Not Be Divided

https://notdivided.org
2310•BloondAndDoom•17h ago•736 comments

747s and Coding Agents

https://carlkolon.com/2026/02/27/engineering-747-coding-agents/
46•cckolon•1d ago•10 comments

Latency numbers every programmer should know

https://cheat.sh/latency
47•ksec•4h ago•14 comments

From Noise to Image – interactive guide to diffusion

https://lighthousesoftware.co.uk/projects/from-noise-to-image/
36•simedw•2d ago•7 comments

OpenAI fires an employee for prediction market insider trading

https://www.wired.com/story/openai-fires-employee-insider-trading-polymarket-kalshi/
150•bookofjoe•4h ago•89 comments

The Life Cycle of Money

https://doap.metal.bohyen.space/blog/post/complete-life-cycle-of-money/
47•nanacnote•4h ago•8 comments

Unsloth Dynamic 2.0 GGUFs

https://unsloth.ai/docs/basics/unsloth-dynamic-2.0-ggufs
139•tosh•8h ago•44 comments

Customer Update on Simplenote

https://forums.simplenote.com/forums/topic/customer-update-on-simplenote/?view=all
50•0in•4h ago•39 comments

The Eternal Promise: A History of Attempts to Eliminate Programmers

https://www.ivanturkovic.com/2026/01/22/history-software-simplification-cobol-ai-hype/
158•dinvlad•3d ago•116 comments

A new California law says all operating systems need to have age verification

https://www.pcgamer.com/software/operating-systems/a-new-california-law-says-all-operating-system...
751•WalterSobchak•1d ago•636 comments

Show HN: Now I Get It – Translate scientific papers into interactive webpages

https://nowigetit.us
74•jbdamask•4h ago•58 comments

Seeing Like a Sedan

https://asteriskmag.com/issues/13/seeing-like-a-sedan
4•surprisetalk•3d ago•0 comments

Don't trust AI agents

https://nanoclaw.dev/blog/nanoclaw-security-model
234•gronky_•5h ago•128 comments

OpenAI agrees with Dept. of War to deploy models in their classified network

https://twitter.com/sama/status/2027578652477821175
1187•eoskx•14h ago•566 comments

US and Israel launch strikes on Iran, as Trump says ‘massive’ campaign underway

https://www.cnn.com/2026/02/28/middleeast/israel-attack-iran-intl-hnk
714•lavp•11h ago•1720 comments

Everything Changes, and Nothing Changes

https://btao.org/posts/2026-02-28-everything-changes-nothing-changes/
23•todsacerdoti•4h ago•14 comments

More Cows, More Wives

https://www.worksinprogress.news/p/more-cows-more-wives
60•oxw•3d ago•34 comments

Show HN: SplatHash – A lightweight alternative to BlurHash and ThumbHash

https://github.com/junevm/splathash
43•unsorted2270•6h ago•16 comments

The whole thing was a scam

https://garymarcus.substack.com/p/the-whole-thing-was-scam
33•guilamu•1h ago•2 comments

OpenAI raises $110B on $730B pre-money valuation

https://techcrunch.com/2026/02/27/openai-raises-110b-in-one-of-the-largest-private-funding-rounds...
546•zlatkov•1d ago•570 comments

Stop Burning Your Context Window – How We Cut MCP Output by 98% in Claude Code

https://mksg.lu/blog/context-mode
69•mksglu•7h ago•14 comments

What AI coding costs you

https://tomwojcik.com/posts/2026-02-15/finding-the-right-amount-of-ai/
197•tomwojcik•4h ago•137 comments