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?

Prelude 9B open European model

https://openeurollm.eu/blog/prelude-announcement
675•magru•5h ago•165 comments

NixOS 26.11

https://nixos.org/blog/announcements/2026/nixos-2611/
268•lostmsu•3h ago•107 comments

Unmodified 748B DeepSeek-v4.1-Flash on one RTX 4090

https://axel-labs.com/research/deepseek-v4-1-flash-on-one-rtx-4090
84•bobbitybobob•2h ago•19 comments

How Far Behind Are Open-Weight Models?

https://sebastianraschka.com/blog/2026/how-far-behind-are-open-weight-models.html
441•ModelForge•6h ago•360 comments

Rex is now available to everyone

https://www.superlogical.com/updates/rex-available-to-everyone
530•kylebarron•5h ago•201 comments

Post-quantum key exchange in Tailscale v1.106

https://tailscale.com/blog/pqc-key-exchange
232•tatersolid•4h ago•37 comments

macOS 27.3: New "Accessibility" Permission Warning Is Beyond Ridiculous

https://wojciechkulik.pl/blog/macos-27-3-new-accessibility-permission-warning-is-beyond-ridiculous/
54•latexr•1h ago•30 comments

Laravel for COBOL

https://github.com/pihedy/laravel-cobol
340•choult•6h ago•111 comments

Cloudflare will be fully post-quantum in 2027

https://blog.cloudflare.com/project-quantum-leap/
708•jupenur•10h ago•393 comments

Vitalik Buterin: How to hard-fork to save most funds in a quantum emergency (2024)

https://ethresear.ch/t/how-to-hard-fork-to-save-most-users-funds-in-a-quantum-emergency/18901
95•olaird25•2h ago•27 comments

MiniMax-M4, an open-weight, natively multimodal Mixture-of-Experts (MoE) model

https://github.com/MiniMax-AI/MiniMax-M4
368•cmrdporcupine•7h ago•129 comments

Man Hooks Up His 1994 Jeep Cherokee to ChatGPT

https://www.thedrive.com/news/man-hooks-up-his-1994-jeep-cherokee-to-chatgpt-and-the-results-are-...
118•thehoff•1d ago•74 comments

Fingerprinting Chess Players by Their Move Timings

https://healeycodes.com/fingerprinting-chess-players-by-their-move-timings
49•healeycodes•7h ago•18 comments

Redmond WA Police secretly implemented AI mass surveillance

https://eastsidewatch.com/news/2026/11/redmond-police-secretly-implemented-ai-mass-surveillance/
153•outcome•1h ago•115 comments

Flux 3.1 Image

https://bfl.ai/blog/flux-3-1
71•leumon•4h ago•17 comments

Steller's sea cow: First historical extinction of a marine mammal at human hands

https://www.nhm.ac.uk/discover/stellers-sea-cow-first-historical-extinction-of-marine-mammal-at-h...
135•zeristor•2d ago•42 comments

Launching S3 Wormhole

https://www.daemonology.net/blog/2026-12-02-Launching-S3-Wormhole.html
133•lewww•1d ago•36 comments

Has Substack Stalled?

https://nymag.com/intelligencer/article/substack-hamish-mckenzie-emily-sundberg-max-stein.html
35•cainxinth•2d ago•36 comments

All software sucks (2007)

https://harmful.cat-v.org/software/
167•archargelod•9h ago•199 comments

Show HN: ArchLang – floor plans as code, compiled to SVG/DXF/PDF

https://playground.archlang.uk/
169•chanmeng•3d ago•54 comments

Video-rate wavefront capture and replay: toward holographic telepresence

https://www.oejournal.org/oea/article/doi/10.29026/oea.2026.260001
3•bookofjoe•32m ago•0 comments

Mistral Crash Dynamics, aka Crashtral

https://mistral.ai/news/mistral-crash-dynamics/
127•acossta•8h ago•10 comments

What Could Object Pascal Look Like in 2030?

https://blogs.remobjects.com/2026/12/02/a-vision-for-pascal-2030-at-ekon/
57•carteragecat•9h ago•30 comments

Show HN: ArkType 3.0 – Set-theoretic precompiled TS validator

https://arktype.io/docs/blog/3.0
31•ssalbdivad•5h ago•7 comments

Show HN: Nixorium – NixOS fleet management, in daily use in my school's labs

https://github.com/giovantenne/nixorium
112•zener79•8h ago•43 comments

This Lady Is Hitting Every Shop in NYC (2024)

https://annekadet.substack.com/p/locavore
76•NaOH•3d ago•35 comments

Show HN: misa77 – Up to 3x faster decompression than zstd, with better ratios

https://github.com/welcome-to-the-sunny-side/misa77/tree/main
245•nonadhocproblem•14h ago•81 comments

Critical 21-year-old Linux flaw lets hackers bypass firewall rules

https://www.bleepingcomputer.com/news/security/critical-21-year-old-linux-flaw-lets-hackers-bypas...
53•ectospheno•2h ago•16 comments

I wish we’d stop talking about how we’re going to cure cancer

https://www.science.org/content/blog-post/stop-it-just-stop-it
1220•surprisetalk•10h ago•736 comments

Bayer's 'Feed a Bee' campaign was used to fight bee protections

https://www.grilled.media/feed-a-bee/
482•randycupertino•8h ago•152 comments