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

Comments

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

TurboQuant: Redefining AI efficiency with extreme compression

https://research.google/blog/turboquant-redefining-ai-efficiency-with-extreme-compression/
132•ray__•3h ago•23 comments

I Forked Httpx

https://tildeweb.nl/~michiel/httpxyz.html
19•roywashere•42m ago•3 comments

VitruvianOS – Desktop Linux Inspired by the BeOS

https://v-os.dev
120•felixding•5h ago•57 comments

Goodbye to Sora

https://twitter.com/soraofficialapp/status/2036532795984715896
684•mikeocool•12h ago•491 comments

Flighty Airports

https://flighty.com/airports
300•skogstokig•8h ago•99 comments

Show HN: I took back Video.js after 16 years and we rewrote it to be 88% smaller

https://videojs.org/blog/videojs-v10-beta-hello-world-again
385•Heff•14h ago•70 comments

Tell HN: Litellm 1.82.7 and 1.82.8 on PyPI are compromised

https://github.com/BerriAI/litellm/issues/24512
649•dot_treo•20h ago•418 comments

Apple Business

https://www.apple.com/newsroom/2026/03/introducing-apple-business-a-new-all-in-one-platform-for-b...
618•soheilpro•17h ago•352 comments

I wanted to build vertical SaaS for pest control, so I took a technician job

https://www.onhand.pro/p/i-wanted-to-build-vertical-saas-for-pest-control-i-took-a-technician-job...
286•tezclarke•11h ago•119 comments

You can run a DNS server (2025)

https://simonsafar.com/2025/running_dns/
65•surprisetalk•4d ago•33 comments

Arm AGI CPU

https://newsroom.arm.com/blog/introducing-arm-agi-cpu
339•RealityVoid•15h ago•253 comments

Show HN: DuckDB community extension for prefiltered HNSW using ACORN-1

https://github.com/cigrainger/duckdb-hnsw-acorn
42•cigrainger•5h ago•3 comments

Fun with CSF firmware (RK3588 GPU firmware)

https://icecream95.gitlab.io/fun-with-csf-firmware.html
23•M95D•3d ago•0 comments

VNDB founder Yorhel has died

https://vndb.org/t24787
14•indrora•2d ago•4 comments

Algorithm Visualizer

https://algorithm-visualizer.org/
86•vinhnx•4d ago•4 comments

Show HN: Email.md – Markdown to responsive, email-safe HTML

https://www.emailmd.dev/
283•dancablam•16h ago•67 comments

Intel Device Modeling Language for virtual platforms

https://github.com/intel/device-modeling-language
28•transpute•4d ago•0 comments

Wine 11 rewrites how Linux runs Windows games at kernel with massive speed gains

https://www.xda-developers.com/wine-11-rewrites-linux-runs-windows-games-speed-gains/
902•felineflock•14h ago•318 comments

A Compiler Writing Journey

https://github.com/DoctorWkt/acwj
74•ibobev•9h ago•5 comments

An Aural Companion for Decades, CBS News Radio Crackles to a Close

https://www.nytimes.com/2026/03/21/business/media/cbs-news-radio-appraisal.html
54•tintinnabula•3d ago•11 comments

Implementing automatic eSIM installation on Android

https://medium.com/proandroiddev/integration-of-automatic-esim-installation-on-android-6c5f6d7124cb
24•nesterenkopavel•3h ago•1 comments

Show HN: Gemini can now natively embed video, so I built sub-second video search

https://github.com/ssrajadh/sentrysearch
315•sohamrj•17h ago•89 comments

Hypothesis, Antithesis, synthesis

https://antithesis.com/blog/2026/hegel/
247•alpaylan•17h ago•85 comments

What happened to GEM?

https://dfarq.homeip.net/whatever-happened-to-gem/
75•naves•4d ago•37 comments

Hypura – A storage-tier-aware LLM inference scheduler for Apple Silicon

https://github.com/t8/hypura
201•tatef•16h ago•76 comments

Missile defense is NP-complete

https://smu160.github.io/posts/missile-defense-is-np-complete/
329•O3marchnative•19h ago•331 comments

A Chess Playing Machine – Shannon (1950) [pdf]

https://www.paradise.caltech.edu/ist4/lectures/shannonchess1950.pdf
13•kristianp•3d ago•2 comments

How the world’s first electric grid was built

https://worksinprogress.co/issue/how-the-worlds-first-electric-grid-was-built/
88•zdw•4d ago•24 comments

The final switch: Goldsboro, 1961

https://blog.nuclearsecrecy.com/2013/09/27/final-switch-goldsboro-1961/
11•1970-01-01•3d ago•2 comments

Nanobrew: The fastest macOS package manager compatible with brew

https://nanobrew.trilok.ai/
205•syrusakbary•21h ago•125 comments