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?

AI;DR (AI; Didn't Read)

https://www.rickmanelius.com/p/aidr-ai-didnt-read
100•mooreds•27m ago•23 comments

A Preview of DuckDB v2.0

https://duckdb.org/2026/08/17/duckdb-20-highlights
420•ibotty•6h ago•66 comments

GPU Offload in Rust: Portable, Safe, and Fast

https://arxiv.org/abs/2608.13759
48•linggen•2h ago•9 comments

AI-Generated GitHub Copilot “Autofix” Allowed Compromise of Snowflake's Jira

https://www.wiz.io/blog/red-agent-snowflake-copilot-cicd-bug
249•galnagli•5h ago•111 comments

Incident with Github.com

https://www.githubstatus.com/incidents/zkxwbgr0cnmx
386•SpyCoder77•6h ago•789 comments

Sun Clock

https://sunclock.net/
81•Gecko4072•3h ago•32 comments

How to disable or avoid intrusive AI

https://www.librarian.net/notoai/
191•ColinWright•6h ago•93 comments

Will you have spent more of your life with computers than your family?

https://beachfront.bearblog.dev/will-you-have-spent-more-of-your-life-with-computers-than-your-fa...
6•Gecko4072•18m ago•0 comments

GPT 5.6 Sol is the best "vision" model OpenAI ever released

https://blog.roboflow.com/openai-gpt-5-6/
254•plurby•8h ago•132 comments

Launch HN: Speko (YC S26) – OpenRouter for Voice AI

https://speko.ai/
75•abdik•4h ago•46 comments

Judge sets framework for Nine PBS to retrieve archival data

https://current.org/2026/08/judge-sets-framework-for-nine-pbs-to-retrieve-archival-data/
67•qingcharles•4h ago•23 comments

AirTag reveals Amazon is trashing rare books to train AI

https://arstechnica.com/tech-policy/2026/08/hidden-airtag-reveals-amazon-is-trashing-rare-books-t...
78•jefurii•1h ago•46 comments

India built the biggest digital payments miracle: Now comes the bill

https://www.bbc.com/news/articles/c8xnwqe00v1o
7•monkey_monkey•49m ago•1 comments

Olo (Color)

https://en.wikipedia.org/wiki/Olo_(color)
192•inigyou•5d ago•46 comments

Roboflow Playground: Try and Compare 30 Computer Vision Models

https://blog.roboflow.com/roboflow-playground/
13•Bluestein•1h ago•1 comments

How I Over-Engineered My Book

https://ben.balter.com/2026/08/17/how-i-over-engineered-my-book/
33•benbalter•1h ago•24 comments

The Oldest Bar in Every US State

https://www.businessinsider.com/oldest-bar-every-state
29•NaOH•4d ago•7 comments

Qwen3.8 27B scores 52 on Artificial Analysis

https://artificialanalysis.ai/models/qwen3-8-27b
185•anana_•2h ago•95 comments

Ask HN: Alternatives to GitHub

395•dhruv3006•6h ago•253 comments

The Lonely Men Who Work in Patagonia, at the End of the World

https://www.newyorker.com/culture/photo-booth/the-lonely-men-at-the-end-of-the-world
58•bookofjoe•1h ago•22 comments

Marketers are Addicted to Bad Data (2020)

https://www.jacquescorbytuech.com/writing/marketers-addicted-bad-data
12•zbentley•4d ago•14 comments

How to put 170 atoms in an atom

https://signoregalilei.com/2026/08/02/how-to-put-170-atoms-in-an-atom/
79•surprisetalk•5h ago•16 comments

Anthropic's ‘watermark’ text adulteration in Claude is a perversion of writing

https://daringfireball.net/2026/08/anthropics_watermark_text_adulteration_in_claude_is_a_perversi...
737•ropbear•22h ago•641 comments

Amazon, which started off selling books, is destroying rare texts to train AI

https://techcrunch.com/2026/08/17/amazon-once-an-online-bookseller-is-destroying-rare-books-to-tr...
70•rzk•2h ago•34 comments

A particle made of force: physicists say they've found mysterious 'glueball'

https://www.nature.com/articles/d41586-026-02498-1
49•Brajeshwar•5d ago•2 comments

How I developed an Am29000 C compiler and web browser

https://nanochess.org/am29000_c_compiler_web_browser.html
62•nanochess•23h ago•9 comments

We Are Forking dotenvy into dotenv-ng

https://secretspec.dev/blog/we-are-forking-dotenvy-into-dotenv-ng/
17•linggen•2h ago•16 comments

Show HN: Sokoban AI Solver

https://mkornreich.me/projects/sokoban/
59•enjoyyourlife•7h ago•33 comments

On AI regulation and messaging

https://twitter.com/DarioAmodei/status/2088758816376807762
218•jacquesm•18h ago•458 comments

Show HN: Learn Flags Quiz

https://flagquizzes.com/
33•artiomyak•6h ago•18 comments