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?

Muse Spark 1.3

https://developer.meta.com/ai/models/muse-spark/
389•bvaldivielso•6h ago•255 comments

Gemini 3.8 Flash and 3.8 Flash Cyber

https://blog.google/innovation-and-ai/models-and-research/gemini-models/3-8-flash-and-3-8-flash-c...
824•bratao•10h ago•483 comments

Google avoids a breakup of its ad tech business

https://www.nytimes.com/2026/09/02/technology/google-ad-tech-remedies.html
263•donohoe•10h ago•175 comments

Holden's Lightning Flight

https://en.wikipedia.org/wiki/Holden%27s_Lightning_flight
53•ColinWright•2d ago•7 comments

Reverse Engineering Unknown File Formats with ImHex

https://werwolv.net/posts/file_format_reverse_engineering/
100•carlos-menezes•2d ago•19 comments

Fable 5.1 World Modeling

https://github.com/PhiloLabs/fable51-worlds
142•surreal_•5h ago•49 comments

Three sites made 215,128 “best software” pages for AI. Perplexity cites them

https://trellner.com/reports/manufactured-sources-behind-ai-recommendations/
309•jakobgreenfeld•11h ago•142 comments

Launch HN: RonanRX (YC S26) – Personalized Peptides and GLP-1s

https://ronanrx.com/
21•lloydarmbrust•3h ago•30 comments

Can I opt out of my input or output data being used for training?

https://help.mistral.ai/en/articles/455207-can-i-opt-out-of-my-input-or-output-data-being-used-fo...
370•teekert•13h ago•164 comments

Engineering of the fastest WebAssembly interpreters

https://wasmi-labs.github.io/blog/posts/wasmi-v2.0/
40•herobird•1d ago•1 comments

The shrinking landscape of linguistic diversity in the age of LLMs

https://www.nature.com/articles/s41562-026-02550-0
27•Anon84•3d ago•4 comments

Wendell Berry has died

https://www.nytimes.com/2026/08/31/us/wendell-berry-dead.html
139•Curiositry•1d ago•74 comments

Reasons robotics is hard

https://secondthoughts.ai/p/14-reasons-robotics-is-hard
33•ddp26•3h ago•5 comments

Biggest dark matter detector spots a single weird particle

https://www.science.org/content/article/world-s-biggest-dark-matter-detector-spots-single-weird-p...
248•randycupertino•11h ago•83 comments

Nango (YC W23) is hiring across eng, product and GTM (SF and remote)

https://nango.dev/careers
1•bastienbeurier•4h ago

Uber shuts operations in Nigeria and Uganda with immediate effect

https://www.bbc.com/news/articles/c86xpv8l9y9o
93•yakkomajuri•3h ago•56 comments

Qantas Airbus A380 engine failure in 2010 (2023)

https://admiralcloudberg.medium.com/a-matter-of-millimeters-the-story-of-qantas-flight-32-bdaa62d...
80•gumby•6h ago•48 comments

Whistleblower warns Postal Service mail ballot system has catastrophic problems

https://www.cbsnews.com/news/whistleblower-postal-service-new-mail-ballot-system/
69•ck2•1d ago•40 comments

Aging brains blend memories together instead of just forgetting them

https://studyfinds.com/aging-brains-blend-memories-together-instead-of-forgetting-them-study-finds/
211•mdp2021•12h ago•92 comments

Exit the Cave

https://turtlespace.blog/p/exit-the-cave
210•akkartik•11h ago•76 comments

Altair Basic Interpreter Source Code (1975) [pdf]

https://images.gatesnotes.com/12514eb8-7b51-008e-41a9-512542cf683b/34d561c8-cf5c-4e69-af47-3782ea...
39•Eridanus2•5h ago•20 comments

METR Report on OpenAI / Hugging Face Hacking Incident

https://metr.org/blog/2026-08-26-openai-hugging-face-incident-investigation/#core-takeaways-about...
84•stikit•2h ago•70 comments

Embedded Rust RTOS vs. C RTOS

https://tweedegolf.nl/en/blog/65/async-rust-vs-rtos-showdown/
54•kooi•7h ago•25 comments

A Selection of Los Alamos Rolodex Business Cards

https://clui.org/collections/los-alamos-business-cards/selection-cards
138•1970-01-01•2d ago•33 comments

Poisson Disk Sampling

https://stripeacross.com/posts/poisson-disk-sampling/
128•vismit2000•11h ago•19 comments

I wanna live an NPC life

https://signalundefied.bearblog.dev/i-wanna-live-an-npc-life/
181•conferza•5h ago•176 comments

Product Backlog Problems: Why Your Hierarchy Is Broken

https://www.prodpad.com/blog/backlog-hierarchy-problem/
15•adrianhoward•2d ago•8 comments

WebLLM: high-performance in-browser LLM inference engine

https://github.com/mlc-ai/web-llm
88•saikatsg•11h ago•17 comments

Making the Internet Boring

https://cemrehancavdar.com/2026/08/30/making-the-internet-boring/
77•zdw•3d ago•43 comments

We could save petabytes of cache storage with Zstandard and Pingora

https://blog.cloudflare.com/cache-transcoding/
64•torutofu•1d ago•29 comments