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

Comments

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

Bun is joining Anthropic

https://bun.com/blog/bun-joins-anthropic
263•ryanvogel•39m ago•100 comments

100000 TPS over a billion rows: the unreasonable effectiveness of SQLite

https://andersmurphy.com/2025/12/02/100000-tps-over-a-billion-rows-the-unreasonable-effectiveness...
60•speckx•44m ago•5 comments

The Junior Hiring Crisis

https://people-work.io/blog/junior-hiring-crisis/
37•mooreds•56m ago•15 comments

I Designed and Printed a Custom Nose Guard to Help My Dog with DLE

https://snoutcover.com/billie-story
165•ragswag•2d ago•20 comments

Learning Music with Strudel

https://terryds.notion.site/Learning-Music-with-Strudel-2ac98431b24180deb890cc7de667ea92
253•terryds•6d ago•62 comments

Mistral 3 family of models released

https://mistral.ai/news/mistral-3
446•pember•3h ago•143 comments

Nixtml: Static website and blog generator written in Nix

https://github.com/arnarg/nixtml
66•todsacerdoti•3h ago•17 comments

YesNotice

https://infinitedigits.co/docs/software/yesnotice/
88•surprisetalk•1w ago•40 comments

Poka Labs (YC S24) Is Hiring a Founding Engineer

https://www.ycombinator.com/companies/poka-labs/jobs/RCQgmqB-founding-engineer
1•arbass•1h ago

Addressing the adding situation

https://xania.org/202512/02-adding-integers
227•messe•7h ago•68 comments

4.3M Browsers Infected: Inside ShadyPanda's 7-Year Malware Campaign

https://www.koi.ai/blog/4-million-browsers-infected-inside-shadypanda-7-year-malware-campaign
31•janpio•2h ago•4 comments

Advent of Compiler Optimisations 2025

https://xania.org/202511/advent-of-compiler-optimisation
280•vismit2000•8h ago•46 comments

Python Data Science Handbook

https://jakevdp.github.io/PythonDataScienceHandbook/
137•cl3misch•6h ago•28 comments

IBM CEO says there is 'no way' spending on AI data centers will pay off

https://www.businessinsider.com/ibm-ceo-big-tech-ai-capex-data-center-spending-2025-12
31•nabla9•34m ago•10 comments

Show HN: Marmot – Single-binary data catalog (no Kafka, no Elasticsearch)

https://github.com/marmotdata/marmot
68•charlie-haley•3h ago•12 comments

Lowtype: Elegant Types in Ruby

https://codeberg.org/Iow/type
28•birdculture•4d ago•7 comments

A series of vignettes from my childhood and early career

https://www.jasonscheirer.com/weblog/vignettes/
113•absqueued•6h ago•76 comments

Apple Releases Open Weights Video Model

https://starflow-v.github.io
385•vessenes•13h ago•127 comments

What will enter the public domain in 2026?

https://publicdomainreview.org/features/entering-the-public-domain/2026/
432•herbertl•15h ago•290 comments

YouTube increases FreeBASIC performance (2019)

https://freebasic.net/forum/viewtopic.php?t=27927
138•giancarlostoro•2d ago•32 comments

School Cell Phone Bans and Student Achievement (NBER Digest)

https://www.nber.org/digest/202512/school-cell-phone-bans-and-student-achievement
4•harias•46m ago•1 comments

Comparing AWS Lambda ARM64 vs. x86_64 Performance Across Runtimes in Late 2025

https://chrisebert.net/comparing-aws-lambda-arm64-vs-x86_64-performance-across-multiple-runtimes-...
108•hasanhaja•9h ago•47 comments

Anthropic Acquires Bun

https://www.anthropic.com/news/anthropic-acquires-bun-as-claude-code-reaches-usd1b-milestone
26•httpteapot•40m ago•10 comments

Lazier Binary Decision Diagrams for set-theoretic types

https://elixir-lang.org/blog/2025/12/02/lazier-bdds-for-set-theoretic-types/
38•tvda•6h ago•5 comments

Beej's Guide to Learning Computer Science

https://beej.us/guide/bglcs/
306•amruthreddi•2d ago•118 comments

Apple to beat Samsung in smartphone shipments for first time in 14 years

https://sherwood.news/tech/apple-to-beat-samsung-in-smartphone-shipments-for-first-time-in-14-years/
31•avonmach•1h ago•29 comments

Progress on TypeScript 7 – December 2025

https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/
28•DanRosenwasser•1h ago•6 comments

How Brian Eno Created Ambient 1: Music for Airports (2019)

https://reverbmachine.com/blog/deconstructing-brian-eno-music-for-airports/
169•dijksterhuis•10h ago•87 comments

An LED panel that shows the aviation around you

https://github.com/AxisNimble/TheFlightWall_OSS
73•yzydserd•5d ago•17 comments

Show HN: RunMat – runtime with auto CPU/GPU routing for dense math

https://github.com/runmat-org/runmat
17•nallana•3h ago•3 comments