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•11mo ago
Code at https://github.com/wiwa/blog-code/

Comments

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

Alberta startup sells no-tech tractors for half price

https://wheelfront.com/this-alberta-startup-sells-no-tech-tractors-for-half-price/
760•Kaibeezy•3h ago•271 comments

Over-editing refers to a model modifying code beyond what is necessary

https://nrehiew.github.io/blog/minimal_editing/
166•pella•2h ago•88 comments

Scores decline again for 13-year-old students in reading and mathematics

https://www.nationsreportcard.gov/highlights/ltt/2023/
57•u1hcw9nx•1h ago•41 comments

Qwen3.6-27B: Flagship-Level Coding in a 27B Dense Model

https://qwen.ai/blog?id=qwen3.6-27b
469•mfiguiere•6h ago•235 comments

5x5 Pixel font for tiny screens

https://maurycyz.com/projects/mcufont/
220•zdw•3d ago•55 comments

You don't need advice from editors on rejected manuscripts

https://twitter.com/orsonscottcard/status/2046702294406680751
39•MrBuddyCasino•11h ago•14 comments

We found a stable Firefox identifier linking all your private Tor identities

https://fingerprint.com/blog/firefox-tor-indexeddb-privacy-vulnerability/
97•danpinto•2h ago•34 comments

Windows 9x Subsystem for Linux

https://social.hails.org/@hailey/116446826733136456
784•sohkamyung•10h ago•184 comments

New study compares growing corn for energy to solar production. It's no contest

https://www.anthropocenemagazine.org/2025/04/new-study-compares-growing-corn-for-energy-to-solar-...
16•dotcoma•49m ago•10 comments

Website streamed live directly from a model

https://flipbook.page/
26•sethbannon•2h ago•10 comments

Martin Fowler: Technical, Cognitive, and Intent Debt

https://martinfowler.com/fragments/2026-04-14.html
109•theorchid•3h ago•20 comments

Our eighth generation TPUs: two chips for the agentic era

https://blog.google/innovation-and-ai/infrastructure-and-cloud/google-cloud/eighth-generation-tpu...
323•xnx•7h ago•157 comments

Surveillance Pricing: Exploiting Information Asymmetries

https://lpeproject.org/blog/surveillance-pricing-exploiting-information-asymmetries/
49•cainxinth•2h ago•18 comments

Parallel Agents in Zed

https://zed.dev/blog/parallel-agents
92•ajeetdsouza•2h ago•45 comments

Bodega cats of New York

https://bodegacatsofnewyork.com
106•zdw•4d ago•45 comments

Ultraviolet corona discharges on treetops during storms

https://www.psu.edu/news/earth-and-mineral-sciences/story/treetops-glowing-during-storms-captured...
162•t-3•6h ago•45 comments

Workspace Agents in ChatGPT

https://openai.com/index/introducing-workspace-agents-in-chatgpt/
42•mfiguiere•2h ago•12 comments

3.4M Solar Panels

https://tech.marksblogg.com/american-solar-farms-v2.html
246•marklit•8h ago•176 comments

The great Scouse pasty war

https://www.livpost.co.uk/the-great-scouse-pasty-war/
6•DamonHD•2d ago•0 comments

GitHub CLI now collects pseudoanonymous telemetry

https://cli.github.com/telemetry
346•ingve•8h ago•266 comments

Columnar Storage Is Normalization

https://buttondown.com/jaffray/archive/columnar-storage-is-normalization/
84•ibobev•7h ago•33 comments

Making RAM at Home [video]

https://www.youtube.com/watch?v=h6GWikWlAQA
565•kaipereira•1d ago•161 comments

Scoring Show HN submissions for AI design patterns

https://www.adriankrebs.ch/blog/design-slop/
239•hubraumhugo•5h ago•185 comments

How does GPS work?

https://perthirtysix.com/how-the-heck-does-gps-work
196•alfanick•10h ago•45 comments

Youth Suicides Declined After Creation of National Hotline

https://www.nytimes.com/2026/04/22/science/988-youth-suicides-decline.html
139•marojejian•4h ago•85 comments

Anonymous credentials: an illustrated primer (Part 2)

https://blog.cryptographyengineering.com/2026/04/17/anonymous-credentials-an-illustrated-primer-p...
6•kkl•2d ago•0 comments

XOR'ing a register with itself is the idiom for zeroing it out. Why not sub?

https://devblogs.microsoft.com/oldnewthing/20260421-00/?p=112247
179•ingve•13h ago•187 comments

Show HN: Broccoli, one shot coding agent on the cloud

https://github.com/besimple-oss/broccoli
27•yzhong94•4h ago•22 comments

Homegrown – An interactive map of every 2025 FBS college football player

https://torch.football/homegrown
9•brockbedard•3h ago•7 comments

DuckDB 1.5.2 – SQL database that runs on laptop, server, in the browser

https://duckdb.org/2026/04/13/announcing-duckdb-152
116•janandonly•5h ago•45 comments