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

Comments

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

Microsoft forced me to switch to Linux

https://www.himthe.dev/blog/microsoft-to-linux
400•bobsterlobster•2h ago•308 comments

Airfoil (2024)

https://ciechanow.ski/airfoil/
141•brk•1h ago•22 comments

Amazon axes 16,000 jobs as it pushes AI and efficiency

https://www.reuters.com/legal/litigation/amazon-cuts-16000-jobs-globally-broader-restructuring-20...
101•DGAP•50m ago•74 comments

Show HN: The HN Arcade

https://andrewgy8.github.io/hnarcade/
181•yuppiepuppie•5h ago•55 comments

Package Management Is a Wicked Problem

https://nesbitt.io/2026/01/23/package-management-is-a-wicked-problem.html
50•zdw•4d ago•30 comments

A verification layer for browser agents: Amazon case study

https://sentienceapi.com/blog/verification-layer-amazon-case-study
15•tonyww•14h ago•4 comments

Show HN: Dwm.tmux – a dwm-inspired window manager for tmux

https://github.com/saysjonathan/dwm.tmux
49•saysjonathan•4d ago•7 comments

Show HN: Cua-Bench – a benchmark for AI agents in GUI environments

https://github.com/trycua/cua
14•someguy101010•1d ago•1 comments

Rust at Scale: An Added Layer of Security for WhatsApp

https://engineering.fb.com/2026/01/27/security/rust-at-scale-security-whatsapp/
171•ubj•10h ago•50 comments

There's only one Woz, but we can all learn from him

https://www.fastcompany.com/91477114/steve-wozniak-woz-apple-the-tech-interactive-humanitarian-award
225•coloneltcb•4d ago•102 comments

A few random notes from Claude coding quite a bit last few weeks

https://twitter.com/karpathy/status/2015883857489522876
793•bigwheels•1d ago•671 comments

Prism

https://openai.com/index/introducing-prism
720•meetpateltech•22h ago•471 comments

SVG Path Editor

https://yqnn.github.io/svg-path-editor/
184•gurjeet•5d ago•27 comments

Virtual Boy on TV with Intelligent Systems Video Boy

https://hcs64.com/video-boy-vue/
66•hcs•7h ago•12 comments

Kyber (YC W23) Is Hiring a Staff Engineer

https://www.ycombinator.com/companies/kyber/jobs/GPJkv5v-staff-engineer-tech-lead
1•asontha•4h ago

Show HN: Extracting React apps from Figma Make's undocumented binary format

https://albertsikkema.com/ai/development/tools/reverse-engineering/2026/01/23/reverse-engineering...
13•albertsikkema•5d ago•6 comments

Show HN: Build Web Automations via Demonstration

https://www.notte.cc/launch-week-i/demonstrate-mode
11•ogandreakiro•1d ago•5 comments

I Overengineered a Spinning Top

https://www.youtube.com/watch?v=Wp5NodfvvF4
6•bane•5d ago•2 comments

Make.ts

https://matklad.github.io/2026/01/27/make-ts.html
159•ingve•8h ago•84 comments

430k-year-old well-preserved wooden tools are the oldest ever found

https://www.nytimes.com/2026/01/26/science/archaeology-neanderthals-tools.html
466•bookofjoe•1d ago•240 comments

Thirty Years of the Square Kilometre Array

https://physicsworld.com/a/thirty-years-of-the-square-kilometre-array-heres-what-the-worlds-large...
50•mooreds•2d ago•13 comments

Golden Ratio using an equilateral triangle inscribed in a circle

https://geometrycode.com/free/how-to-graphically-derive-the-golden-ratio-using-an-equilateral-tri...
138•peter_d_sherman•4d ago•37 comments

Pandas 3.0

https://pandas.pydata.org/community/blog/pandas-3.0.html
196•jonbaer•4d ago•70 comments

Rust’s Standard Library on the GPU

https://www.vectorware.com/blog/rust-std-on-gpu/
231•justaboutanyone•4d ago•46 comments

Doing the thing is doing the thing

https://www.softwaredesign.ing/blog/doing-the-thing-is-doing-the-thing
494•prakhar897•1d ago•164 comments

I Made a MIT Licensed Mecrisp-Stellaris Language Server

https://mecrisp-stellaris-folkdoc.sourceforge.io/mecrisp-stellaris-lsp.html
16•oldguy101•3d ago•3 comments

Lennart Poettering, Christian Brauner founded a new company

https://amutable.com/about
343•hornedhob•21h ago•539 comments

Dole Kemp 96 Web Site

https://www.dolekemp96.org/main.htm
40•DamnInteresting•1h ago•46 comments

Parametric CAD in Rust

https://campedersen.com/vcad
204•ecto•19h ago•150 comments

Amazon closing its Fresh and Go stores

https://finance.yahoo.com/news/amazon-closing-fresh-grocery-convenience-150437789.html
282•trenning•1d ago•499 comments