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?

DeepSeek V4 Pro 0813

https://openrouter.ai/deepseek/deepseek-v4-pro-0813
857•explosion-s•14h ago•336 comments

Tailscale Traces Database Corruption to 16y/o SQLite WAL-Reset Bug

https://tailscale.com/blog/sqlite-wal-reset-bug
952•ropbear•16h ago•179 comments

Delta

https://zed.dev/blog/introducing-delta
493•khy•12h ago•169 comments

Qwen3.8-2.4T

https://huggingface.co/Qwen/Qwen3.8-2.4T-A95B
572•Philpax•15h ago•130 comments

Mushroom behind 'tiny people' hallucinations identified

https://phys.org/news/2026-08-qa-mushroom-tiny-people-hallucinations.html
41•wglb•5d ago•11 comments

Principia Mathematica is modern and insightful

https://okmij.org/ftp/Computation/Impressions/PrincipiaMathematica.html
114•matt_d•7h ago•51 comments

Antiqua–Fraktur dispute

https://en.wikipedia.org/wiki/Antiqua%E2%80%93Fraktur_dispute
52•buzzy_hacker•2d ago•5 comments

2026 Eclipse Webcams

https://jonty.github.io/2026_eclipse_webcams/
473•zoenolan•18h ago•128 comments

Why Target Common Lisp for Code Generation?

http://funcall.blogspot.com/2026/08/why-vibe-code-in-lisp.html
80•oumua_don17•21h ago•58 comments

Happy 45th Birthday to the IBM PC and Model F/XT

https://sharktastica.co.uk/articles/pc-fxt-45
65•tart-lemonade•6h ago•20 comments

Build Wide, Ship Narrow

https://adapt.com/blog/build-wide-ship-narrow
76•ashumz•6h ago•17 comments

Tim King, AmigaDOS developer, has died

https://amiga-news.de/en/news/AN-2026-08-00070-EN.html
256•doener•16h ago•31 comments

uBlock Origin Is Giving Up the Fight to Keep Ads Off Facebook

https://digitalescapetools.com/2026/08/ublock-origin-stops-chasing-facebook-ads.html
396•Markoff•18h ago•516 comments

HTML over WebSockets: real-time SPAs with barely any JavaScript

https://en.andros.dev/blog/ef4968f5/html-over-websockets-real-time-spas-with-barely-any-javascript/
177•redbell•13h ago•122 comments

Grok 4.6

https://x.ai/news/grok-4-6
496•iLuddite•14h ago•456 comments

Launch HN: Discovered Materials (YC P26) – AI agents to discover new materials

https://discoveredmaterials.com/research/
131•advaith08•22h ago•28 comments

Thanks to social media, canned sardines are a scarcity on the supermarket shelf

https://corneroffifth.studio/why-cant-you-find-canned-sardines-right-now/
96•carabiner•8h ago•110 comments

From rubber boots to Copa: When MicroProse Soccer revolutionized football

https://spillhistorie.no/2026/08/08/fra-gummistovler-til-copa-da-microprose-soccer-revolusjonerte...
9•TMWNN•3d ago•0 comments

Why tiny JPEGs look different in Chrome

https://guillaumetech.github.io/posts/jpg-scaling-chrome/
287•gutechh•16h ago•62 comments

Someone is running mass vulnerability scans, spoofing AI bots like ClaudeBot

https://knownagents.com/insights
261•gavinhking•16h ago•194 comments

Locating an unknown source of radiation in a heterogeneous environment (2019)

https://repository.lib.ncsu.edu/items/451b001d-e63a-4968-866d-3fb3a599b1e7
22•toomuchtodo•4d ago•20 comments

Pixel Watch 5

https://blog.google/products-and-platforms/devices/pixel/pixel-watch-5/
128•ortusdux•14h ago•244 comments

Breaking the WAL

https://antithesis.com/blog/2026/wal-reset-bug/
88•wwilson•10h ago•42 comments

Show HN: Ballet – Workflow automation that writes integrations against any API

https://www.ballet.dev/
28•danielkimber•6h ago•7 comments

Lovable raises $400M Series C

https://lovable.dev/blog/series-c
124•thoughtpeddler•14h ago•120 comments

Shade Map

https://shademap.app
179•fredley•17h ago•45 comments

AI is removing the middle class of software engineering?

https://blog.florianherrengt.com/ai-removing-middle-class-software-engineering.html
831•florianherrengt•17h ago•755 comments

Show HN: Woxi - Open-source Mathematica / Wolfram Language reimplementation

https://woxi.ad-si.com
278•adius•20h ago•39 comments

Process as a Proxy for Motivation

https://bengodfrey.dev/blog/process/
51•sudo-bendg•8h ago•15 comments

License plate reader searches should require a warrant

https://andrewpwheeler.com/2026/08/12/license-plate-reader-searches-should-require-a-warrant/
573•apwheele•15h ago•341 comments