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?

Why is this fingerprinting script creating bioweapons?

https://nullpt.rs/fingerprinting-bioweapons
445•hazebooth•4h ago•95 comments

Gemini 4 Carbon

https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-carbon/
645•acossta•4h ago•528 comments

CNC Stone Carving

https://carmelitegothic.com/cnc-stone-carving/
335•bschne•6h ago•105 comments

Dayjob: Tax – evaluating AI agents on 50 professional tax assignments

https://surgehq.ai/blog/dayjob-tax
157•landonxi•5h ago•83 comments

MacBook Pro with PROLED XDR Display and Touch

https://www.apple.com/macbook-pro/proled-xdr-display/
415•etothet•4h ago•701 comments

The Grid, a factory-scale robot in Massachusetts that builds PCBs on demand

https://www.circuithub.com/post/unveiling-the-grid
358•seddona•2d ago•178 comments

Nango (YC W23) Is Hiring Across Eng, FDE, Marketing, DevRel

https://nango.dev/careers
1•bastienbeurier•28m ago

Start Doing Graph Theory

https://vertex.degree/
513•ibobev•5d ago•114 comments

The Style Is Father of the Man

https://harpers.org/archive/2026/11/benjamin-kunkel-reviews-cormac-mccarthy-legacy-revisted/
6•lermontov•4d ago•2 comments

Leak Exposes 41,000 Homeland Security Workers–Including Undercover ICE Agents

https://www.wired.com/story/massive-leak-exposes-41000-homeland-security-workers-including-underc...
42•Aboutplants•24m ago•9 comments

AlpineBSD

https://wiki.alpinebsd.org
139•bradley_taunt•6h ago•115 comments

The case of the 9 bit AES key

https://v12.sh/blog/the-case-of-the-9bit-aes-key
4•ledoge•36m ago•1 comments

Apple's git still trusts the compromised eMudhra certificates

https://emudhra.we-have-a-problem.com/apple.html
959•galadran•10h ago•364 comments

The tragedy of losing your Wikipedia page

https://www.wired.com/story/the-tragedy-of-losing-your-wikipedia-page/
9•tptacek•2d ago•14 comments

Spiders Spin 'Silk Dope' into Nature's Toughest Material

https://www.quantamagazine.org/how-spiders-spin-silk-dope-into-natures-toughest-material-20261028/
21•ibobev•3h ago•0 comments

The Agent SDK

https://cursor.com/blog/agent-sdk
78•torutofu•7h ago•90 comments

Show HN: SlideBySide – Present slides without sharing your screen

https://slidebyside.com/
41•denismenace•4h ago•18 comments

Gaussian Splats part 3: There's always a bigger scene

https://www.magnopus.com/blog/gaussiansplats-part-3-theres-always-a-bigger-scene
81•ibobev•5d ago•18 comments

Emacs Turns 50

https://www.technologyreview.com/2026/10/20/1145399/emacs-turns-50/
361•internet_points•8h ago•152 comments

Regent's Ground-Effect Vehicle Reimagines Coastal Travel

https://spectrum.ieee.org/ground-effect-vehicle
40•rbanffy•3d ago•31 comments

Oseberg Tapestry Fragments

https://en.wikipedia.org/wiki/Oseberg_tapestry_fragments
8•benbreen•2d ago•0 comments

Google AI gets cagey when asked who won the 2020 elections

https://arstechnica.com/ai/2026/10/google-ai-gets-cagey-when-asked-who-won-the-2020-elections/
29•jacquesm•1h ago•19 comments

Archive.today links going forward

https://www.reddit.com/r/Seattle/comments/1xhf6qp/archivetoday_links_going_forward/
139•consumer451•5h ago•91 comments

Decompiling Fast Food Tycoon 2: Drawing the World

https://healeycodes.com/decompiling-fast-food-tycoon-2-drawing-the-world
180•healeycodes•4d ago•37 comments

Kentucky man becomes the first humanist granted religious exemption from AI

https://religionnews.com/2026/10/26/in-a-first-a-humanist-granted-a-religious-exemption-from-usin...
365•danso•7h ago•424 comments

Executable Archaeology: Reanimating the Heuristic Compiler (1961) and KBEmacs (1984)

https://arxiv.org/abs/2610.36341
14•abrax3141•19h ago•0 comments

Nvidia Nemotron 3.5 Transcribe: open ASR for 40 languages

https://huggingface.co/blog/nvidia/nemotron-transcribe-granary
90•wondersky•6h ago•16 comments

US agency approves Amazon Leo’s $11.5B acquisition of Globalstar

https://www.reuters.com/business/media-telecom/us-agency-approves-amazon-leos-115-billion-acquisi...
211•noptd•9h ago•98 comments

Meta censored the No Kings Instagram account during a nationwide campaign

https://paulfwalsh.substack.com/p/meta-censored-the-no-kings-instagram
75•slowin•5h ago•8 comments

MacOS Extensions Pack for the Apple Network Server v1.0

http://oldvcr.blogspot.com/2026/10/macos-extensions-pack-for-apple-network.html
116•classichasclass•3d ago•2 comments