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?

Nvidia Reinstates Jensen Huang as CEO

https://www.cnbc.com/2026/11/23/nvidia-jensen-huang-ceo.html
1870•jaz•9h ago•2951 comments

Ladybird is now in alpha

https://ladybird.org/posts/alpha/
1237•janvdberg•7h ago•305 comments

Stalwart is now a drop-in replacement for Microsoft Exchange

https://stalw.art/blog/microsoft-exchange-replacement/
41•shaunpud•46m ago•17 comments

VP ≠ VNP over Every Field

https://github.com/anthropics/formal-math/tree/main/vp-vnp
109•mikeryan52•1h ago•74 comments

Per Arm's request, this site will be discontinued on 4 December 2026 :(

https://arm.jonpalmisc.com/
733•tech234a•4h ago•152 comments

GPUI is getting its own repository

https://github.com/zed-industries/gpui
52•EvilGoose•2h ago•6 comments

Bored.com: Fun, interesting and cool websites to explore when bored

https://www.bored.com/
56•susam•2h ago•16 comments

GLM-5.4: Toward generalized coding with our first loop transformer

https://z.ai/blog/glm-5.4
1011•foohis•13h ago•331 comments

Levent Alpöge comments on his Riemann Hypothesis proof

https://twitter.com/__alpoge__/status/2124987173439209561
22•Dylan1312•56m ago•12 comments

Dario is hyping the dangers so OSS models are illegal and he stays in control

https://twitter.com/ylecun/status/2124550037912920090
922•MrBuddyCasino•6h ago•530 comments

NariQ: BF16-level Qwen3.8-27B in a 10 GB file

https://huggingface.co/nari-labs/Qwen3.8-27B-NariQ-GGUF
103•toebee•9h ago•18 comments

Derivative Flipping

http://blog.sigfpe.com/2026/11/derivative-flipping.html
56•dmit•1d ago•6 comments

Spacecraft reaches Mercury on second-ever mission to enter its orbit

https://www.theguardian.com/science/2026/nov/20/spacecraft-mercury-second-ever-mission-orbit-bepi...
268•geden•2d ago•85 comments

The Beauty of Artists' Studios

https://spectator.com/article/the-beauty-of-artists-studios/
5•promulgator•30m ago•0 comments

Kagi Mail (public beta)

https://blog.kagi.com/kagi-mail-public-beta
311•rdmuser•6h ago•237 comments

The horse made the state

https://aeon.co/essays/the-origins-of-the-state-are-not-agrarian-but-pastoralist
47•ersinesen•2h ago•46 comments

Show HN: Hermit CRM – Free open-source CRM for solopreneurs

https://hermitcrm.io/
27•gijsbos•13h ago•2 comments

Nospeaker ─ Make your MacBook's trackpad talk using its haptic motor

https://github.com/os6/nospeaker
261•yakkomajuri•11h ago•153 comments

EasyPost (YC S13) Is Hiring

https://www.easypost.com/careers/
1•jstreebin•6h ago

Show HN: PlaceBench – Testing AI on opening and closing hours (and last trains)

https://github.com/voygr-tech/placebench
7•ymarkov•5d ago•0 comments

C++26 is done (again): ISO C++ meeting trip report

https://herbsutter.com/2026/11/21/c26-is-done-again-trip-report-november-2026-iso-c-standards-mee...
90•dverlaeckt80•1d ago•79 comments

Win4wine – Run Windows Shell as the Linux Desktop on Wine

https://github.com/mikuta0407/win4wine
204•hard_times•10h ago•107 comments

Apple removed my open-source app from EU App Stores after 9 years

https://github.com/glushchenko/fsnotes/discussions/2056
445•fluder•4h ago•91 comments

Free alternative TV network built from the Internet Archive's forgotten videos

https://spelunkr.tv
914•SockThief•22h ago•159 comments

What does it mean to understand what we built?

https://brooker.co.za/blog/2026/11/16/understanding.html
13•luu•1d ago•1 comments

Next gaming monitor should still be an OLED

https://www.rockpapershotgun.com/theyre-more-complicated-and-more-expensive-than-lcd-screens-but-...
4•Tomte•2h ago•0 comments

The AI conversation we're not having

https://www.gnanaguru.com/blog/things-two-years-in-ai-taught-me/
7•gnanaguru16•1h ago•3 comments

Show HN: Type-C – variants, options, generics and pattern matching for C

https://github.com/stass/type-c
9•stass•1d ago•0 comments

XNU Linux: Full OS X GUI Userspace on Linux

https://github.com/AFK-surf/xnulinux
592•mmastrac•19h ago•243 comments

How should an LLM see a computer?

https://www.greptile.com/blog/trex-computer-use
36•dakshgupta•5h ago•20 comments