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

Comments

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

NewPipe: YouTube client without vertical videos and algorithmic feed

https://newpipe.net/
108•nvader•2h ago•26 comments

uBlock filter list to hide all YouTube Shorts

https://github.com/i5heu/ublock-hide-yt-shorts/
639•i5heu•9h ago•212 comments

News publishers limit Internet Archive access due to AI scraping concerns

https://www.niemanlab.org/2026/01/news-publishers-limit-internet-archive-access-due-to-ai-scrapin...
423•ninjagoo•8h ago•278 comments

I love the work of the ArchWiki maintainers

https://k7r.eu/i-love-the-work-of-the-archwiki-maintainers/
56•panic•2h ago•7 comments

IBM tripling entry-level jobs after finding the limits of AI adoption

https://fortune.com/2026/02/13/tech-giant-ibm-tripling-gen-z-entry-level-hiring-according-to-chro...
282•WhatsTheBigIdea•1d ago•147 comments

My smart sleep mask broadcasts users' brainwaves to an open MQTT broker

https://aimilios.bearblog.dev/reverse-engineering-sleep-mask/
353•minimalthinker•11h ago•177 comments

Ooh.directory: a place to find good blogs that interest you

https://ooh.directory/
452•hisamafahri•13h ago•120 comments

Zvec: A lightweight, fast, in-process vector database

https://github.com/alibaba/zvec
77•dvrp•1d ago•15 comments

Instagram's URL Blackhole

https://medium.com/@shredlife/instagrams-url-blackhole-c1733e081664
96•tkp-415•1d ago•13 comments

Can my SPARC server host a website?

https://rup12.net/posts/can-my-sparc-server-host-my-website/
35•e145bc455f1•4d ago•25 comments

5,300-year-old 'bow drill' rewrites story of ancient Egyptian tools

https://www.ncl.ac.uk/press/articles/latest/2026/02/ancientegyptiandrillbit/
75•geox•3d ago•5 comments

Flood Fill vs. The Magic Circle

https://www.robinsloan.com/winter-garden/magic-circle/
42•tobr•3d ago•14 comments

Amsterdam Compiler Kit

https://github.com/davidgiven/ack
102•andsoitis•10h ago•26 comments

The Perfect Device

https://sometimes.digital/posts/the-perfect-device/
10•surprisetalk•3d ago•1 comments

Show HN: Off Grid – Run AI text, image gen, vision offline on your phone

https://github.com/alichherawalla/off-grid-mobile
44•ali_chherawalla•4h ago•11 comments

Ask HN: How to get started with robotics as a hobbyist?

171•StefanBatory•6d ago•76 comments

The consequences of task switching in supervisory programming

https://martinfowler.com/fragments/2026-02-13.html
45•bigwheels•1d ago•20 comments

Show HN: MOL – A programming language where pipelines trace themselves

https://github.com/crux-ecosystem/mol-lang
23•MouneshK•3d ago•9 comments

Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

https://github.com/datavorous/sameshi
197•datavorous_•13h ago•59 comments

Discord: A case study in performance optimization

https://newsletter.fullstack.zip/p/discord-a-case-study-in-performance
53•tylerdane•1d ago•34 comments

Colored Petri Nets, LLMs, and distributed applications

https://blog.sao.dev/cpns-llms-distributed-apps/
30•stuartaxelowen•6h ago•4 comments

Unicorn Jelly

https://unicornjelly.com/
45•avaer•14h ago•10 comments

Launching Interop 2026

https://hacks.mozilla.org/2026/02/launching-interop-2026/
50•linolevan•1d ago•3 comments

A review of M Disc archival capability with long term testing results (2016)

http://www.microscopy-uk.org.uk/mag/artsep16/mol-mdisc-review.html
65•1970-01-01•11h ago•77 comments

A header-only C vector database library

https://github.com/abdimoallim/vdb
66•abdimoalim•9h ago•24 comments

Descent, ported to the web

https://mrdoob.github.io/three-descent/
168•memalign•7h ago•33 comments

YouTube as Storage

https://github.com/PulseBeat02/yt-media-storage
173•saswatms•18h ago•129 comments

Windows NT/OS2 Design Workbook

https://computernewb.com/~lily/files/Documents/NTDesignWorkbook/
83•markus_zhang•4d ago•31 comments

How many registers does an x86-64 CPU have? (2020)

https://blog.yossarian.net/2020/11/30/How-many-registers-does-an-x86-64-cpu-have
89•tosh•13h ago•66 comments

Vim 9.2

https://www.vim.org/vim-9.2-released.php
350•tapanjk•11h ago•146 comments