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•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?

Bun's experimental Rust rewrite hits 99.8% test compatibility on Linux x64 glibc

https://twitter.com/jarredsumner/status/2053047748191232310
399•heldrida•15h ago•381 comments

Rust but Lisp

https://github.com/ThatXliner/rust-but-lisp
63•thatxliner•3h ago•31 comments

Internet Archive Switzerland

https://blog.archive.org/2026/05/06/internet-archive-switzerland-expanding-a-global-mission-to-pr...
531•hggh•13h ago•77 comments

The Serial TTL connector we deserve

https://kohlschuetter.github.io/blog/posts/2026/05/07/serial-ttl-connector/
38•kohlschuetter•2d ago•32 comments

I’ve banned query strings

https://chrismorgan.info/no-query-strings
256•susam•8h ago•142 comments

Local privilege escalation via execve()

https://www.freebsd.org/security/advisories/FreeBSD-SA-26:13.exec.asc
80•Deeg9rie9usi•4h ago•56 comments

Show HN: I made a Clojure-like language in Go, boots in 7ms

https://github.com/nooga/let-go
85•marcingas•7h ago•25 comments

Zed Editor Theme-Builder

https://zed.dev/theme-builder
154•cuechan•7h ago•44 comments

Making your own programming language is easier than you think (but also harder)

https://lisyarus.github.io/blog/posts/making-your-own-programming-language.html
39•ibobev•2d ago•11 comments

CPanel's Black Week: 3 New Vulnerabilities Patched After Attack on 44k Servers

https://www.copahost.com/blog/cpanels-black-week-three-new-vulnerabilities-patched-after-ransomwa...
107•ggallas•8h ago•58 comments

The first microcomputer: The transfluxor-powered Arma Micro Computer from 1962

https://www.righto.com/2024/02/the-first-microcomputer-transfluxor.html
15•rsecora•3d ago•0 comments

Distributing Mac software is increasing my cortisol levels

https://blog.kronis.dev/blog/apple-is-increasing-my-cortisol-levels
200•LorenDB•10h ago•134 comments

Production engineering when trading billions of dollars a day [video]

https://www.youtube.com/watch?v=zR9PpXWsKFQ
88•abstrus•1d ago•21 comments

LLMs corrupt your documents when you delegate

https://arxiv.org/abs/2604.15597
350•rbanffy•16h ago•135 comments

I'm writing a history of Visual Basic, Chapter 1 is up

https://evilgeniuslabs.ca/blog/visual-basic-history-chapter-1-launch
11•speckx•3d ago•5 comments

A recent experience with ChatGPT 5.5 Pro

https://gowers.wordpress.com/2026/05/08/a-recent-experience-with-chatgpt-5-5-pro/
601•_alternator_•22h ago•425 comments

Meta's embrace of A.I. is making its employees miserable

https://www.nytimes.com/2026/05/08/technology/meta-ai-employees-miserable.html
273•JumpCrisscross•6h ago•236 comments

The hypocrisy of cyberlibertarianism

https://matduggan.com/the-intolerable-hypocrisy-of-cyberlibertarianism/
257•ColinWright•11h ago•214 comments

EU Parliamentary Research Service calls VPNs "a loophole that needs closing"

https://cyberinsider.com/eu-calls-vpns-a-loophole-that-needs-closing-in-age-verification-push/
387•muse900•19h ago•274 comments

France Moves to Break Encrypted Messaging

https://reclaimthenet.org/france-moves-to-break-encrypted-messaging
61•Cider9986•3h ago•24 comments

Getting arrested in Japan

https://sundaicity.com/blogs/getting-arrested-in-japan
132•bane•3h ago•133 comments

Using Claude Code: The unreasonable effectiveness of HTML

https://twitter.com/trq212/status/2052809885763747935
416•pretext•20h ago•236 comments

Surfel-based global illumination on the web

https://juretriglav.si/surfel-based-global-illumination-on-the-web/
10•vmg12•6h ago•0 comments

I caught the car

https://undecidability.net/senior/
37•holden_nelson•4h ago•32 comments

Random tie knots (2014)

https://tieknots.how/
10•surprisetalk•3d ago•1 comments

PipeDream on the Acorn Archimedes

https://stonetools.ghost.io/pipedream-archimedes/
74•msephton•10h ago•36 comments

OpenAI’s WebRTC problem

https://moq.dev/blog/webrtc-is-the-problem/
470•atgctg•2d ago•140 comments

Mythical Man Month

https://martinfowler.com/bliki/MythicalManMonth.html
348•ingve•2d ago•190 comments

Forking the Web

https://dillo-browser.org/lab/web-fork/
106•wrxd•13h ago•113 comments

America's carpet capital: an empire and its toxic legacy

https://apnews.com/projects/pfas-forever-stained/
158•rawgabbit•3d ago•99 comments