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?

Plug-in solar is coming. Plug-in batteries should follow

https://www.regen.co.uk/insights/plug-in-solar-is-coming-plug-in-batteries-should-follow
53•thelastgallon•1h ago•29 comments

Go 1.27 Interactive Tour

https://victoriametrics.com/blog/go-1-27/index.html
84•Hixon10•2h ago•21 comments

MkLinux and the pimped-out Apple Workgroup Server 9150

http://oldvcr.blogspot.com/2026/08/mklinux-and-pimped-out-apple-workgroup.html
19•goldenskye•1h ago•1 comments

Seedance 2.5

https://seed.bytedance.com/en/blog/one-take-creation-flexible-referencing-introducing-seedance-2-5
225•njaremko•7h ago•109 comments

Diátaxis

https://diataxis.fr/
247•ryanseys•7h ago•33 comments

ASRock BC-250: Building the Budget Steam Machine

https://plug-world.com/posts/2026/asrock-bc250-the-budget-steam-machine/
31•plug_world•2h ago•7 comments

Deep-sea vehicles spot 'alien' sharks deep beneath the waves in the Pacific

https://www.science.org/content/article/deep-sea-vehicles-spot-alien-sharks-deep-beneath-waves-pa...
14•pkaeding•1h ago•2 comments

Show HN: I'm a 15 Year Old Wannabe Engineer, This Is a Cycloidal Gearbox I Built

https://github.com/tom-ilan/cycloidal_gearbox
49•tomilan•2h ago•14 comments

RFC 10015: Deprecating Obsolete Key Exchange Methods in TLS 1.2 and DTLS 1.2

https://www.rfc-editor.org/rfc/rfc10015.html
43•Jimmc414•4h ago•5 comments

AI financial advice is surprisingly good, especially if you ask right questions

https://mitsloan.mit.edu/ideas-made-to-matter/ai-financial-advice-surprisingly-good-especially-if...
220•foxtrot8672•5h ago•195 comments

Unraveling the mysteries of habit formation

https://www.kyoto-u.ac.jp/en/research-news/2026-07-28
48•hhs•5h ago•17 comments

Postmortem for Kernel Soundness Bug #14576

https://leodemoura.github.io/blog/2026-8-1-postmortem-for-kernel-soundness-bug-14576/
128•juhopitk•9h ago•45 comments

When random.bytes() runs but doesn't work

https://insider.btcpp.dev/p/when-randombytes-runs-but-doesnt
8•Funes-•2h ago•0 comments

Show HN: CostPerPrompt – Live AI API pricing and real-workload cost calculators

https://costperprompt.com/
6•ahmed_hassan7•2h ago•2 comments

Four Time Scales for Technology Development and Deployment

https://rodneybrooks.com/four-time-scales-for-technology-development-and-deployment/
14•jeffreyrogers•1h ago•1 comments

But can your calculator run Linux?

https://raymii.org/s/articles/But_can_your_calculator_run_Linux.html
76•jandeboevrie•8h ago•6 comments

Morph (YC S23) Is Hiring Member of Technical Staff

https://www.ycombinator.com/companies/morph/jobs/0Z8vI3K-member-of-technical-staff
1•bhaktatejas922•5h ago

The Art of 64-bit Assembly

https://nostarch.com/art-64-bit-assembly-v2
209•0x54MUR41•14h ago•90 comments

China begins producing advanced chipmaking deep-ultraviolet lithography machines

https://www.reuters.com/world/china/china-starts-production-home-grown-immersion-duv-chipmaking-t...
51•ck2•2d ago•38 comments

How Google helped destroy adoption of RSS feeds (2023)

https://openrss.org/blog/how-google-helped-destroy-adoption-of-rss-feeds
456•pudgywalsh•10h ago•159 comments

We accidentally built an LLVM compiler for Jax

https://iza.ac/posts/2026/07/accidental-llvm-compiler-for-jax/
22•infinitewalk•2d ago•8 comments

Nyctography: A substituton cypher by Lewis Carroll

https://en.wikipedia.org/wiki/Nyctography
60•nanna•4d ago•8 comments

NetBSD 11.0

https://blog.netbsd.org/tnf/entry/netbsd_11_0_released
236•jaypatelani•10h ago•107 comments

Kenji/Serious Eats – 30-Min Pressure Cooker Pho Ga

https://www.seriouseats.com/30-minute-pressure-cooker-pho-ga-recipe
116•stasomatic•12h ago•66 comments

The Theater of Sport: Bill Buford Revisits Among the Thugs

https://www.theparisreview.org/blog/2026/07/29/the-theater-of-sport-bill-buford-revisits-among-th...
9•Thevet•3d ago•1 comments

Atom is better than RSS, in ways that matter

https://chrismorgan.info/atom%3Erss
26•frizlab•6h ago•3 comments

Explorative modeling: Train on the best of K guesses

https://alexiglad.github.io/blog/2026/explorative_modeling/
86•DSemba•13h ago•24 comments

CISA Alert: Water Sector PLC Targeting

https://censys.com/blog/cisa-alert-water-tower-plc-targeting/
85•speckx•9h ago•60 comments

Glyphs 4 – the leading Mac font editor

https://glyphsapp.com
67•microflash•4d ago•10 comments

Linux on ESP32

https://github.com/GrieferPig/esp32-s31-linux
106•boveyking•4d ago•37 comments