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?

A domain can now say it is for sale, in DNS

https://specification.website/spec/foundations/for-sale-dns/
45•shaunpud•1h ago•18 comments

Don't use your phone while you poop

https://nate.spot/no-phone-while-poop/
22•ExMachina73•35m ago•16 comments

DeepMind's WeatherNext model achieves breakthrough forecasting cyclones

https://deepmind.google/blog/weathernext-ai-model-achieves-breakthrough-in-forecasting-cyclones/
160•bhavansig•5h ago•49 comments

Voyager 1 FDS Computer Emulator

https://zaneham.github.io/voyager-fds-emulator/
9•rahen•1h ago•0 comments

A Physicist Rigged His Pet Hamster’s Wheel to Upload to Strava

https://www.runnersworld.com/news/a73355106/hamster-wheel-strava-running/
326•aanet•2d ago•73 comments

Gateway 2000's hilariously bad ads in the 90s (Part II)

https://buttondown.com/suchbadtechads/archive/gateway-2000-part-2/
14•rfarley04•2h ago•2 comments

Hardware backdoors in some x86 CPUs

https://github.com/xoreaxeaxeax/rosenbridge
222•epestr•7h ago•67 comments

No One Can Afford to Make Myst Games Anymore

https://www.wired.com/story/no-one-can-afford-to-make-myst-games-anymore/
30•littlexsparkee•2d ago•23 comments

DeepSeek V4 Flash 0731

https://arcprize.org/results/deepseek-v4-flash-0731
697•tosh•20h ago•419 comments

U.S. Department of Energy Launches the Genesis Open Models Initiative

https://genesisopenmodels.anl.gov/
286•moelf•16h ago•107 comments

What happens if an entire class of workers loses faith in their careers

https://www.noemamag.com/why-is-everyone-in-tech-so-sad/
815•RickJWagner•1d ago•906 comments

Gentoo bugzilla closed due AI bot scraper overload

https://social.treehouse.systems/@mgorny/117058483039362779
16•happosai•45m ago•1 comments

k-Coloring is Faster than Computing the Chromatic Number

https://arxiv.org/abs/2607.25973
32•matt_d•1w ago•3 comments

Europe's free satellite service just made it easier to track wildfires

https://arstechnica.com/gadgets/2026/08/europes-free-satellite-service-just-made-it-easier-to-tra...
91•01-_-•4h ago•9 comments

Assembly Hall of Shame

https://github.com/xoreaxeaxeax/asm-hall-of-shame
380•piotrgrabowski•20h ago•93 comments

ao486: x86-compatible Verilog core implementing all features of a 486 SX (2014)

https://github.com/alfikpl/ao486
43•csmantle•6d ago•6 comments

Ancient Library – 1,060 Greek/Latin texts, click any word to parse it

https://ancientlibrary.net/
227•aagha•19h ago•72 comments

Now we have a timeline of the OpenAI accidental attack against Hugging Face

https://simonwillison.net/2026/Aug/7/openai-timeline/
108•882542F3884314B•3h ago•129 comments

NASA figured out how to keep its Voyager 2 probe running for another year

https://www.space.com/space-exploration/voyager/nasa-figured-out-how-to-keep-its-48-year-old-voya...
305•wglb•12h ago•62 comments

Microsoft Edge is about to lock out older ad blockers, just like Chrome did

https://www.theverge.com/tech/976880/microsoft-edge-extensions-ad-blockers-mv2-mv3
53•eternalreturn•4h ago•47 comments

2027 memory capacity is reportedly sold out

https://www.ign.com/articles/ramageddon-continues-another-year-as-2027-memory-capacity-is-reporte...
424•inigyou•1d ago•410 comments

Show HN: Rotating torus in terminal (but with kitty graphics protocol)

https://andreadimatteo.com/torus-v0-5.html
9•deotman•6d ago•2 comments

SupererDuperer

https://www.shirtpocket.com/blog/supererduperer
136•zdw•6d ago•28 comments

Managing AI Coding Costs at Scale

https://www.databricks.com/blog/managing-ai-coding-costs-scale
272•moonikakiss•20h ago•228 comments

The Nixpkgs core team has disbanded

https://discourse.nixos.org/t/the-nixpkgs-core-team-has-disbanded/79413
345•Meleagris•13h ago•168 comments

From One Seed to a Thousand Leaves – Merkle's Authentication Tree

https://0xkrt26.github.io/math_behind_security/2026/08/03/merkle-tree.html
32•denismenace•4d ago•3 comments

An all-sky map of half a million supermassive black holes

https://www.sdss.org/black-hole-mapper-release-20/
180•MarcoDewey•23h ago•40 comments

Carl's Required Reading

https://carlkolon.com/reading/
204•cckolon•6d ago•26 comments

Radical Study Suggests Life on Earth Arose Twice

https://www.sciencealert.com/radical-study-suggests-life-on-earth-arose-from-non-living-matter-twice
177•jnord•1d ago•110 comments

Responding to the next frontier of critical cyber capabilities

https://openai.com/index/responding-next-frontier-critical-cyber-capabilities/
191•artninja1988•22h ago•185 comments