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?

Virginia bans sale of geolocation data

https://www.hunton.com/privacy-and-cybersecurity-law-blog/virginia-bans-sale-of-geolocation-data
494•toomuchtodo•5h ago•89 comments

An American Privacy Emergency

https://scottaaronson.blog/?p=9902
138•flowercalled•2h ago•37 comments

crustc: entirety of `rustc`, translated to C

https://github.com/FractalFir/crustc
133•Philpax•3h ago•27 comments

GitHub is proud to announce that you can now obtain your public repo on CD-ROM

https://forms.cloud.microsoft/pages/responsepage.aspx?id=v4j5cvGGr0GRqy180BHbR6G-c11n8yFDlQmk4B-Q...
60•throwaway2027•2h ago•42 comments

Reality has a surprising amount of detail (2017)

https://johnsalvatier.org/blog/2017/reality-has-a-surprising-amount-of-detail
141•vinhnx•5d ago•48 comments

Exapunks (2018)

https://www.zachtronics.com/exapunks/
220•yu3zhou4•7h ago•80 comments

Since Linux 6.9, LUKS suspend stopped wiping disk-encryption keys from memory

https://mathstodon.xyz/@iblech/116769502749142438
404•IngoBlechschmid•10h ago•190 comments

Right to Local Intelligence

https://righttointelligence.org/
29•thoughtpeddler•2h ago•11 comments

Mystery identity of 'Green Boots' climber is finally solved after DNA test

https://www.dailymail.com/news/article-15943905/Mystery-identity-Green-Boots-climber-macabre-land...
53•FireBeyond•3h ago•22 comments

Podman v6.0.0

https://blog.podman.io/2026/07/introducing-podman-v6-0-0/
396•soheilpro•11h ago•156 comments

PeerTube is a free, decentralized and federated video platform

https://github.com/Chocobozzz/PeerTube
516•doener•14h ago•231 comments

EFF letter to FTC on X consent order (2 July 2026) [pdf]

https://cdn.arstechnica.net/wp-content/uploads/2026/07/EFF-letter-to-FTC-on-X-consent-order-7-2-2...
106•Terretta•6h ago•32 comments

How to ask for help from people who don't know you

https://pradyuprasad.com/writings/how-to-ask-for-help/
394•FigurativeVoid•12h ago•63 comments

FoundationDB's Flow – Bringing Actor-Based Concurrency to C++11

https://apple.github.io/foundationdb/flow.html
32•sourdecor•11h ago•5 comments

This is my attempt to get Vulkan going on NetBSD

https://github.com/segaboy/vulkan-netbsd
82•segaboy81•7h ago•18 comments

Postgres transactions are a distributed systems superpower

https://www.dbos.dev/blog/co-locating-workflow-state-with-your-data
112•KraftyOne•7h ago•55 comments

Show HN: zkGolf – Competitive optimization of formally verified circuits

https://zk.golf/
39•rot256•10h ago•3 comments

Lightning Memory-Mapped Database Manager (LMDB) 1.0

http://www.lmdb.tech/doc/
62•radiator•6h ago•37 comments

Superpowers 6

https://blog.fsck.com/2026/06/15/Superpowers-6/
74•seahorseemoji•2d ago•35 comments

Immich 3.0

https://github.com/immich-app/immich/discussions/29439
200•hashier•11h ago•90 comments

Show HN: Gitstock–Transform you GitHub commit history into K-line and animations

https://gitstock.org/
9•dares2573•2d ago•1 comments

The short leash AI coding method for beating Fable

https://blog.okturtles.org/2026/07/short-leash-ai-method/
65•Riseed•6h ago•63 comments

Show HN: Inkwell – An RSS reader for e-ink devices

https://kendal.codeberg.page/inkwell/
26•imkendal•10h ago•3 comments

Claude-real-video - any LLM can watch a video

https://github.com/HUANGCHIHHUNGLeo/claude-real-video
82•cortexosmain•6h ago•28 comments

Great Salt Lake Tracker – Grow the Flow

https://growtheflowutah.org/laketracker/
61•cfowles•6h ago•22 comments

Show HN: Pieces – Social network for people

https://try.piecesof.me/
30•domo__knows•1d ago•18 comments

Apricot Computers: An underrated British brand

https://dfarq.homeip.net/apricot-computers-an-underrated-british-brand/
22•giuliomagnifico•1d ago•7 comments

A Special Wireless-Free Nikon Camera Is Publicly Available for the First Time

https://petapixel.com/2026/06/24/a-special-wireless-free-nikon-camera-is-publicly-available-for-t...
17•HardwareLust•1w ago•11 comments

JEP 539: Strict Field Initialization in the JVM moved to preview

https://openjdk.org/jeps/539
56•za3faran•7h ago•17 comments

Show HN: ctx – Search the coding agent history already on your machine

https://github.com/ctxrs/ctx
26•luca-ctx•10h ago•7 comments