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?

Elevated errors on claude.ai, Claude Code, and platform.claude.com

https://status.claude.com/incidents/nn11wk485zfn
38•__vivek•7m ago•24 comments

Jensen Huang resigns

https://apnews.com/article/nvidia-megaspeed-china-singapore-huang-5403f152a601cf82ce939f1d24fffa0f
3579•lldb•20h ago•3147 comments

IceWM

https://ice-wm.org/
181•inatreecrown2•5h ago•90 comments

The Dawn of the Data Intelligence Engineer

https://motherduck.com/blog/the-data-intelligence-engineer/
22•jonbaer•1h ago•22 comments

Rust 1.100

https://blog.rust-lang.org/2026/11/12/Rust-1.100.0/
690•mbStavola•15h ago•259 comments

Brave Search API now accepts agentic payments via the x402 protocol

https://brave.com/blog/search-api-agentic-payments/
107•sjdh76•7h ago•70 comments

Show HN: My $300 embroidery machine needed a subscription, so I built my own app

https://github.com/simpsoka/zigzag
529•simpsoka•17h ago•183 comments

Gemini 4 Hydrogen and Orchestrator

https://antigravity.google/blog/gemini-4-hydrogen-in-google-antigravity/
420•jonbaer•15h ago•115 comments

Edge0-145B: Frontier AI Capabilities on Your Own Computer

https://edge0.ai/blog/introducing-edge0-145b-frontier-ai-capabilities-on-your-own-computer
255•sroussey•11h ago•72 comments

Dwarf planet candidate appears which takes roughly 280 years to orbit our sun

https://www.smithsonianmag.com/smart-news/astronomers-found-a-mysterious-object-orbiting-far-beyo...
315•cybermango•15h ago•129 comments

Former Nvidia CEO Huang had a relationship with a second employee, sources say

https://www.reuters.com/technology/former-nvidia-ceo-huang-had-relationship-with-second-employee-...
285•jbredeche•14h ago•293 comments

Switcher (2004)

https://folklore.org/Switcher.html
100•sammatilda•7h ago•28 comments

Claude Is Down

https://status.claude.com/history
9•cornfieldlabs•5m ago•1 comments

I'm making LLMs work on small and old devices

https://github.com/hyperionaidev/smolmaxxing/
372•mrashad74•19h ago•134 comments

Service degradation on Microsoft 365

https://status.cloud.microsoft/
897•dkpk•16h ago•783 comments

Foundation Models framework

https://developer.apple.com/foundation-models-framework/
214•kermatt•13h ago•29 comments

Microsoft Outlook/365 still down after 12 hours

https://twitter.com/MSFT365Status/status/2121079061774491735
296•player85•5h ago•194 comments

Global Microsoft Outage

https://www.cnn.com/2026/11/12/business/live-news/microsoft-global-outage-intl-hnk
102•TechTechTech•4h ago•35 comments

Turning a 22-year-old Postgres type-confusion primitive into RCE

https://mehmetince.net/part-3-6-how-i-ended-up-turning-a-22-year-old-postgresql-type-confusion-pr...
195•ozirus•16h ago•38 comments

Abandoned Quake 4 expansion finished by modders and now playable

https://www.moddb.com/mods/openq4/downloads/openq4-0141-windows-x64
273•klaussilveira•20h ago•101 comments

Nvidia employees petition to bring back Jensen Huang

https://www.wired.com/story/nvidia-employees-petition-for-jensen-huangs-return/
596•lavendermon•8h ago•436 comments

Anthropic IPO

https://ipo.anthropic.com/us/
937•josephljohnston•22h ago•868 comments

TSMC Hacked

https://www.sec.gov/Archives/edgar/data/1046179/000104617926000800/a20261112statementregardin.htm
47•gmays•2h ago•6 comments

Relax: JIT compiler for Rust to reduce build times

https://makepad.github.io/relax/
162•adamnemecek•1d ago•74 comments

Sift: LSP, Lint, Format Lisp, Scheme and Emacs Lisp

https://github.com/jjba23/sift
59•jjba23•1d ago•8 comments

Show HN: AgentRun – open-source, Self-improving Managed Agents

https://github.com/Parcha-ai/agentrun/blob/main/README.md
108•miguelrios•16h ago•28 comments

Talking Zen 6 with Mike Clark at AMD In-Depth

https://chipsandcheese.com/p/talking-zen-6-with-mike-clark-at
219•dverlaeckt80•20h ago•5 comments

Gemini 4 Hydrogen

https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-hydr...
531•dvaplima•16h ago•333 comments

Show HN: Kapso – Iterative learning from enterprise data

46•alirezamshi•16h ago•11 comments

Show HN: RealtimeVAD – trading false positives for 110ms earlier end-of-speech

https://github.com/KoljaB/RealtimeVAD
25•koljab•12h ago•5 comments