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?

Fixfest is a global gathering of repairers, tinkerers, and activists

https://fixfest.therestartproject.org/
54•robtherobber•1h ago•0 comments

Building a Procedural Hex Map with Wave Function Collapse

https://felixturner.github.io/hex-map-wfc/article/
102•imadr•1h ago•19 comments

JSLinux Now Supports x86_64

https://bellard.org/jslinux/
38•TechTechTech•1h ago•9 comments

Launch HN: Terminal Use (YC W26) – Vercel for filesystem-based agents

27•filipbalucha•1h ago•15 comments

DARPA's new X-76 Experimental Plane

https://www.darpa.mil/news/2026/darpa-new-x-76-speed-of-jet-freedom-of-helicopter
36•newer_vienna•1h ago•31 comments

Show HN: The Mog Programming Language

https://moglang.org
12•belisarius222•38m ago•1 comments

Restoring a Sun SPARCstation IPX Part 1: PSU and Nvram

https://www.rs-online.com/designspark/restoring-a-sun-sparcstation-ipx-part-1-psu-and-nvram
52•ibobev•3h ago•25 comments

Show HN: DenchClaw – Local CRM on Top of OpenClaw

https://github.com/DenchHQ/DenchClaw
33•kumar_abhirup•3h ago•16 comments

Fontcrafter: Turn Your Handwriting into a Real Font

https://arcade.pirillo.com/fontcrafter.html
334•rendx•9h ago•110 comments

Flash media longevity testing – 6 years later

https://old.reddit.com/r/DataHoarder/comments/1q6xnun/flash_media_longevity_testing_6_years_later/
80•1970-01-01•1d ago•31 comments

What I Always Wanted to Know about Second Class Values

https://dl.acm.org/doi/epdf/10.1145/3759427.3760373
12•todsacerdoti•1h ago•0 comments

Jolla on track to ship new phone with Sailfish OS, user-replaceable battery

https://liliputing.com/the-new-jolla-phone-with-sailfish-os-is-on-track-to-start-shipping-in-the-...
85•heresie-dabord•1h ago•38 comments

Uber is letting women avoid male drivers and riders in the US

https://www.dexerto.com/entertainment/uber-is-letting-women-avoid-male-drivers-and-riders-in-the-...
26•randycupertino•35m ago•16 comments

Ireland shuts last coal plant, becomes 15th coal-free country in Europe (2025)

https://www.pv-magazine.com/2025/06/20/ireland-coal-free-ends-coal-power-generation-moneypoint/
664•robin_reala•8h ago•402 comments

Reverse-engineering the UniFi inform protocol

https://tamarack.cloud/blog/reverse-engineering-unifi-inform-protocol
103•baconomatic•5h ago•40 comments

FreeBSD Capsicum vs. Linux Seccomp Process Sandboxing

https://vivianvoss.net/blog/capsicum-vs-seccomp
81•vermaden•5h ago•24 comments

An opinionated take on how to do important research that matters

https://nicholas.carlini.com/writing/2026/how-to-win-a-best-paper-award.html
13•mad•2h ago•1 comments

US Court of Appeals: TOS may be updated by email, use can imply consent [pdf]

https://cdn.ca9.uscourts.gov/datastore/memoranda/2026/03/03/25-403.pdf
472•dryadin•12h ago•368 comments

Algebraic topology: knots links and braids

https://aeb.win.tue.nl/at/algtop-5.html
28•marysminefnuf•4h ago•1 comments

Show HN: I gave my robot physical memory – it stopped repeating mistakes

https://github.com/robotmem/robotmem
6•robotmem•1h ago•0 comments

Show HN: VS Code Agent Kanban: Task Management for the AI-Assisted Developer

https://www.appsoftware.com/blog/introducing-vs-code-agent-kanban-task-management-for-the-ai-assi...
77•gbro3n•8h ago•36 comments

FFmpeg at Meta: Media Processing at Scale

https://engineering.fb.com/2026/03/02/video-engineering/ffmpeg-at-meta-media-processing-at-scale/
161•sudhakaran88•12h ago•77 comments

The Window Chrome of Our Discontent

https://pxlnv.com/blog/window-chrome-of-our-discontent/
119•zdw•2d ago•64 comments

Grammarly is offering ‘expert’ AI reviews from famous dead and living writers

https://www.wired.com/story/grammarly-is-offering-expert-ai-reviews-from-your-favorite-authors-de...
94•jmsflknr•4d ago•107 comments

Segagaga Has Been Translated into English

https://www.thedreamcastjunkyard.co.uk/2026/02/segagaga-has-finally-been-translated.html
80•nanna•1d ago•31 comments

Unlocking Python's Cores:Energy Implications of Removing the GIL

https://arxiv.org/abs/2603.04782
97•runningmike•3d ago•69 comments

Is legal the same as legitimate: AI reimplementation and the erosion of copyleft

https://writings.hongminhee.org/2026/03/legal-vs-legitimate/
113•dahlia•3h ago•121 comments

Ask HN: What Are You Working On? (March 2026)

247•david927•18h ago•907 comments

Lazy JWT Key Rotation in .NET: Redis-Powered JWKS That Just Works

https://www.aaronpina.com/lazy-jwt-key-rotation-in-net-redis-powered-jwks-that-just-works/
10•aaronpina•1d ago•6 comments

Revealed: UK's multibillion AI drive is built on 'phantom investments'

https://www.theguardian.com/technology/2026/mar/09/revealed-uks-multibillion-ai-drive-is-built-on...
61•tablets•3h ago•30 comments