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•6mo ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•6mo ago
What are the biggest use cases of GPU accelerated sorting?

Pebble Watch software is now 100% open source

https://ericmigi.com/blog/pebble-watch-software-is-now-100percent-open-source
120•Larrikin•50m ago•30 comments

Claude Opus 4.5

https://www.anthropic.com/news/claude-opus-4-5
232•adocomplete•50m ago•76 comments

Cool-retro-term: terminal emulator which mimics look and feel of the old CRTs

https://github.com/Swordfish90/cool-retro-term
49•michalpleban•1h ago•17 comments

Shai-Hulud Returns: Over 300 NPM Packages Infected

https://helixguard.ai/blog/malicious-sha1hulud-2025-11-24
667•mrdosija•9h ago•601 comments

The Bitter Lesson of LLM Extensions

https://www.sawyerhood.com/blog/llm-extension
26•sawyerjhood•1h ago•1 comments

We're (now) moving from OpenBSD to FreeBSD for firewalls

https://utcc.utoronto.ca/~cks/space/blog/sysadmin/OpenBSDToFreeBSDMove
79•zdw•5d ago•30 comments

Mind-reading devices can now predict preconscious thoughts

https://www.nature.com/articles/d41586-025-03714-0
30•srameshc•1h ago•13 comments

Three Years from GPT-3 to Gemini 3

https://www.oneusefulthing.org/p/three-years-from-gpt-3-to-gemini
37•JumpCrisscross•1d ago•6 comments

TSMC Arizona Outage Saw Fab Halt, Apple Wafers Scrapped

https://www.culpium.com/p/tsmc-arizona-outage-saw-fab-halt
24•speckx•1h ago•4 comments

NSA and IETF, part 3: Dodging the issues at hand

https://blog.cr.yp.to/20251123-dodging.html
264•upofadown•7h ago•128 comments

Corvus Robotics (YC S18): Hiring Head of Mfg/Ops, Next Door to YC Mountain View

1•robot_jackie•2h ago

Launch HN: Karumi (YC F25) – Personalized, agentic product demos

7•tonilopezmr•1h ago•7 comments

Inside Rust's std and parking_lot mutexes – who wins?

https://blog.cuongle.dev/p/inside-rusts-std-and-parking-lot-mutexes-who-win
95•signa11•4d ago•20 comments

GrapheneOS migrates server infrastructure from France

https://www.privacyguides.org/news/2025/11/22/grapheneos-migrates-server-infrastructure-from-fran...
48•01-_-•55m ago•10 comments

Chrome Jpegxl Issue Reopened

https://issues.chromium.org/issues/40168998
155•markdog12•7h ago•56 comments

Is your Android TV streaming box part of a botnet?

https://krebsonsecurity.com/2025/11/is-your-android-tv-streaming-box-part-of-a-botnet/
33•todsacerdoti•56m ago•16 comments

Shopping research in ChatGPT

https://openai.com/index/chatgpt-shopping-research/
6•wertyk•1h ago•1 comments

Serflings is a remake of The Settlers 1

https://www.simpleguide.net/serflings.xhtml
110•doener•2d ago•36 comments

Ask HN: Scheduling stateful nodes when MMAP makes memory accounting a lie

6•leo_e•2h ago•3 comments

We stopped roadmap work for a week and fixed bugs

https://lalitm.com/fixits-are-good-for-the-soul/
208•lalitmaganti•1d ago•285 comments

Show HN: Cynthia – Reliably play MIDI music files – MIT / Portable / Windows

https://www.blaizenterprises.com/cynthia.html
71•blaiz2025•5h ago•17 comments

Historically Accurate Airport Dioramas by AV Pro Designs

https://www.core77.com/posts/138995/Historically-Accurate-Airport-Dioramas-by-AV-Pro-Designs
29•surprisetalk•4d ago•6 comments

Disney Lost Roger Rabbit

https://pluralistic.net/2025/11/18/im-not-bad/
436•leephillips•6d ago•214 comments

The history of Indian science fiction

https://altermag.com/articles/the-secret-history-of-indian-science-fiction
3•adityaathalye•2d ago•0 comments

RuBee

https://computer.rip/2025-11-22-RuBee.html
320•Sniffnoy•16h ago•56 comments

Google's new 'Aluminium OS' project brings Android to PC

https://www.androidauthority.com/aluminium-os-android-for-pcs-3619092/
21•jmsflknr•53m ago•17 comments

Slicing Is All You Need: Towards a Universal One-Sided Distributed MatMul

https://arxiv.org/abs/2510.08874
84•matt_d•5d ago•9 comments

Japan's gamble to turn island of Hokkaido into global chip hub

https://www.bbc.com/news/articles/c8676qpxgnqo
264•1659447091•16h ago•388 comments

Show HN: I built an interactive map of jobs at top AI companies

https://map.stapply.ai
5•kalil0321•1h ago•0 comments

Ask HN: Hearing aid wearers, what's hot?

321•pugworthy•17h ago•187 comments