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?

Android May Soon Restrict On-Device ADB

https://kitsumed.github.io/blog/posts/android-may-soon-restrict-on-device-adb/
627•shscs911•9h ago•279 comments

Stolen Buttons

https://anatolyzenkov.com/stolen-buttons
78•Gecko4072•5d ago•23 comments

Spatial languages: Writing code in 2D

https://shukla.io/blog/2026-07/cccx.html
47•BinRoo•3d ago•14 comments

My Images Are Dithered

https://dead.garden/blog/how-my-images-are-dithered.html
106•surprisetalk•3d ago•44 comments

Bitchat Is Now on Radicle

https://radicle.network/nodes/rosa.radicle.network/rad%3Az2v9tRJz1oknFAqCSY5W5c76nVvm6
34•h1watt•2h ago•10 comments

The Fedora 45 Sausage Factory

https://supakeen.com/weblog/the-fedora-45-sausage-factory/
71•6581•5h ago•9 comments

Hannah Fry Wins the Leelavati Prize in 2026 for Mathematics Outreach

https://www.maths.cam.ac.uk/features/professor-hannah-fry-wins-leelavati-prize
450•agnishom•14h ago•76 comments

Building a Tiny 3D Renderer for a Tiny Handheld

https://saffroncr.itch.io/katavatis/devlog/1534514/building-a-tiny-3d-renderer-for-a-tiny-handheld
154•g0xA52A2A•2d ago•12 comments

Claude Opus 5

https://www.anthropic.com/news/claude-opus-5
1711•alvis•23h ago•1170 comments

NYC Apartment Aquaponics

https://erinmurphy.dev/projects/project-2/
135•mm1119•5d ago•55 comments

Charles Ross spent 50 yrs building Star Axis naked-eye observatory in New Mexico

https://www.nytimes.com/2026/07/22/arts/design/charles-ross-star-axis-land-art.html
70•ChrisArchitect•2d ago•10 comments

MouthPad: A Tongue-Controlled Touchpad

https://www.augmental.tech/
84•ZaninAndrea•8h ago•19 comments

Zero roadkill as Amazon canopy bridges secure 15,000 crossings

https://news.mongabay.com/2026/07/zero-roadkill-as-amazon-canopy-bridges-secure-15000-crossings/
37•hn_acker•3d ago•0 comments

Kyber (YC W23) Is Hiring a Head of Engineering

https://www.ycombinator.com/companies/kyber/jobs/FGmI8mx-head-of-engineering
1•asontha•4h ago

PyPI Blog: Releases now reject new files after 14 days

https://blog.pypi.org/posts/2026-07-22-releases-now-reject-new-files-after-14-days/
60•miketheman•3d ago•25 comments

GC and Exceptions in Wasmtime

https://bytecodealliance.org/articles/wasmtime-gc
138•phickey•4d ago•22 comments

ARC-AGI Leaderboard

https://arcprize.org/leaderboard
145•rzk•9h ago•121 comments

UK AISI / Caisi Preliminary Assessment of Kimi K3's Cyber Capabilities

https://www.nist.gov/news-events/news/2026/07/uk-aisi-caisi-preliminary-assessment-kimi-k3s-cyber...
104•walrus01•11h ago•31 comments

Opus 5 is currently #1 on Artificial Analysis Intelligence Leaderboard

https://artificialanalysis.ai/models
357•aarondong•20h ago•208 comments

Extinct Media Museum Tokyo

https://extinct-media-museum.blog.jp/otemachi/
86•sohkamyung•10h ago•17 comments

Postgres LISTEN/NOTIFY actually scales

https://www.dbos.dev/blog/postgres-listen-notify-scalability
348•KraftyOne•21h ago•67 comments

India's first privately-developed rocket reaches orbit on debut launch

https://arstechnica.com/space/2026/07/indias-first-privately-developed-rocket-reaches-orbit-on-dr...
658•sohkamyung•5d ago•197 comments

My security camera shipped a GitHub admin token in its login page

https://hhh.hn/hanwha-github-token/
629•hhh•1d ago•211 comments

An old patent inspired the new "Y-zipper", a three-sided fastener

https://news.mit.edu/2026/three-sided-y-zipper-design-0504
250•crescit_eundo•3d ago•45 comments

Firefox Containers Preview

https://blog.mozilla.org/en/firefox/firefox-containers-preview/
436•twapi•3d ago•120 comments

Show HN: I simulated closing the Strait of Hormuz on real oil trade data

https://globaloilnetwork.staffinganalytics.io/
233•eliotho•2d ago•112 comments

Kimi K3 exploited the latest Redis server

https://twitter.com/fried_rice/status/2080059356322918777
264•Alifatisk•1d ago•88 comments

Designing an Ethernet Switch ASIC

https://essenceia.github.io/projects/ethernet_switch_asic/
238•random__duck•4d ago•55 comments

Book Corners: Community map of neighborhood book exchange spots

https://www.bookcorners.org
47•NaOH•2d ago•33 comments

Sperm Whales blow bubbles to achieve restful, vertical sleep

https://news.st-andrews.ac.uk/archive/sperm-whales-blow-bubbles-to-achieve-restful-vertical-sleep/
114•hhs•16h ago•29 comments