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?

Zed DeltaDB

https://zed.dev/deltadb
243•ahamez•4h ago•112 comments

Discovery Loop

https://www.discoveryloop.com/
506•xtreak29•6h ago•311 comments

The Title Cards in Blade Runner Are Fucking Amazing

https://randsinrepose.com/archives/blade-runner-title-cards/
55•ExMachina73•1h ago•12 comments

I'm switching my phone from Android to Linux

https://runarcn.no/android-to-linux/
133•speckx•3h ago•98 comments

Changes at Google DeepMind: Demis Hassabis from CEO to Chair, Jeff Dean departs

https://blog.google/company-news/inside-google/message-ceo/next-chapter-ai-momentum/
384•colesantiago•6h ago•508 comments

Nvidia's Vera Whitepaper Has a Thread Loose

https://chipsandcheese.com/p/nvidias-vera-whitepaper-has-a-thread
38•pella•1h ago•3 comments

Beating GPT-5.6 Sol on retrieval with 100x cheaper open models

https://neon.com/blog/how-castform-neon-beats-frontier-models-on-price-and-efficiency
173•moonikakiss•4h ago•35 comments

Atlassian Rovo Exfiltrates Data, Bypassing Controls

https://www.promptarmor.com/resources/atlassian-rovo-exfiltrates-data
135•hackerBanana•5h ago•48 comments

Prime Agent: A self-improving RLM agent

https://www.primeintellect.ai/blog/prime-agent
51•Xeophon•1h ago•5 comments

Muse Code and Muse Spark 1.2

https://research.meta.ai/blog/introducing-muse-code-and-muse-spark-1-2
128•paulkrush•3h ago•74 comments

GNU Hurd News 2026-Q2

https://www.gnu.org/software/hurd/news/2026-q2.html
104•plaguna•3d ago•69 comments

Celld: Self-hosted, distributed Durable Objects

https://github.com/denoland/celld
116•calvinfo•6h ago•17 comments

Exact, parallel 2D Delaunay triangulation for int32 coordinates

https://github.com/morishuz/delaunay32
10•oryx1729•5d ago•1 comments

Goodhart's Law Comes for Every Benchmark You Trust

https://cacm.acm.org/blogcacm/goodharts-law-comes-for-every-benchmark-you-trust/
44•pseudolus•5d ago•16 comments

Launch HN: HyperProbe (YC S26) – Agents that do read-only debugging in prod

https://www.hyperprobe.co
35•shailendraht•6h ago•24 comments

Online Friends Are Real Friends

https://toska.bearblog.dev/re-online-friends-are-real-friends/
50•Tomte•5d ago•31 comments

What happens if you put work into the second dimension?

https://norbertkozsir.com/posts/work-in-the-second-dimension/
34•abelsm•4h ago•28 comments

The Valley of Webhooks

https://weli.dev/blog/the-valley-of-webhooks/
136•weli•7h ago•63 comments

Sula: A Gemini protocol server written in Scryer Prolog

https://sagredo.dev/projects/sula/
32•triska•4h ago•1 comments

Discovery of a multicomponent alloy forged by the Hiroshima atomic blast

https://www.science.org/doi/10.1126/sciadv.aeg8299
98•_____k•6d ago•38 comments

The Entropy of a Markov Chain

https://chillphysicsenjoyer.substack.com/p/the-entropy-of-a-markov-chain
95•surprisetalk•9h ago•8 comments

Cloudflare OS: an open platform for agents, apps, and work

https://blog.cloudflare.com/cloudflare-os/
432•speckx•9h ago•223 comments

Meta Ran Ads That Contained AI-Generated Child Sexual Abuse Imagery

https://www.wired.com/story/meta-ran-ads-that-contained-ai-generated-child-sexual-abuse-imagery/
199•malshe•3h ago•157 comments

Phishers are hijacking legitimate cloud infrastructure

https://securelist.com/cloud-platforms-in-phishing/120832/
38•lschueller•5h ago•13 comments

Building an Advanced Agentic Harness

https://data4sci.com/blog/building-an-advanced-agentic-harness
96•Anon84•9h ago•40 comments

Rubin Observatory's first LSST Camera release: 500k galaxies in the COSMOS field

https://rubinobservatory.org/news/rubin-new-window-cosmos-field
82•MarcoDewey•8h ago•12 comments

Aristotle quotes on virtue, knowledge, and happiness

https://www.campion.edu.au/blog/top-25-aristotle-quotes-on-virtue-knowledge-and-happiness/
146•teleforce•8h ago•66 comments

Painting with Gaussians

https://yogthos.net/posts/2026-08-03-splat-painter.html
86•yogthos•9h ago•14 comments

Stop sending me your errors

https://kramkow.ski/article/2026/08/05/stop_sending_me_your_errors.html
37•speckx•6h ago•2 comments

Position: LLMs Can't Jump

https://openreview.net/challenge?redirect=%2Fforum%3Fid%3DklU4737opt
228•theanonymousone•11h ago•155 comments