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?

Mario Meets Pareto

https://www.mayerowitz.io/blog/mario-meets-pareto
531•theanonymousone•5h ago•111 comments

Launch HN: ProvenMetal (YC S26) delivers circuit boards in days instead of weeks

https://provenmetal.com
50•willcarkner•1h ago•32 comments

Show HN: The Channels SDK – Bring Any Agent to Any Channel (Slack, MS Teams)

https://github.com/CopilotKit/channels-sdk
39•davidmckayv•1h ago•6 comments

Cities Are Ditching Flock, Replacing It with Axon License Plate Readers

https://www.404media.co/cities-are-ditching-flock-immediately-replacing-it-with-axon-license-plat...
34•cdrnsf•20m ago•2 comments

Humans missed 1 in 3 threats approving AI agent commands across 40k game runs

https://scalex.dev/blog/ai-agent-permissions-stats/
166•Wirbelwind•5h ago•126 comments

Crime Pays but Botany Doesn't

https://www.crimepaysbutbotanydoesnt.com/reading-list
509•DarkContinent•12h ago•156 comments

How to Make a Nintendo 64 Game in 2026

https://phoboslab.org/log/2026/08/xibalba64-making-of
354•atan2•2d ago•119 comments

The Simple Elegance of the Integrated Timing Belt Loopback Fastener

https://danielmangum.com/posts/integrated-timing-belt-loopback-fastener/
25•hasheddan•4d ago•9 comments

Pareto Front

https://en.wikipedia.org/wiki/Pareto_front
159•binyu•1w ago•70 comments

Show HN: I spent 2 years designing a mechanical Magic Keyboard

https://electronicmaterialsoffice.com/
147•aemerson_•2h ago•103 comments

Discovery Loop

https://www.discoveryloop.com/
856•xtreak29•1d ago•526 comments

Changes at Google DeepMind: Demis Hassabis from CEO to Chair, Jeff Dean departs

https://blog.google/company-news/inside-google/message-ceo/next-chapter-ai-momentum/
776•colesantiago•1d ago•837 comments

Join Me in Jamverse

https://contraptions.venkateshrao.com/p/join-me-in-jamverse
30•surprisetalk•6d ago•5 comments

Poles of Inaccessibility in the San Gabriel Mountains

https://notes.secretsauce.net/notes/2015/05/06_poles-of-inaccessibility-in-the-san-gabriel-mounta...
7•dima55•4d ago•0 comments

Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

https://nanochess.org/the_am29000_computer.html
97•nanochess•5d ago•19 comments

The title cards in Blade Runner are amazing

https://randsinrepose.com/archives/blade-runner-title-cards/
377•ExMachina73•19h ago•180 comments

Beating GPT-5.6 Sol on retrieval with 100x cheaper open models

https://neon.com/blog/how-castform-neon-beats-frontier-models-on-price-and-efficiency
388•moonikakiss•22h ago•108 comments

Nashville uses eminent domain to block data center near zoo

https://nashvillebanner.com/2026/08/04/metro-council-data-center-eminent-domain-vote/
23•DeepLogin•1h ago•1 comments

Born Against, or why hobby programming communities are against LLM usage

https://blog.fogus.me/llm/born-against.html
370•lladnar•22h ago•411 comments

Muse Code and Muse Spark 1.2

https://research.meta.ai/blog/introducing-muse-code-and-muse-spark-1-2
302•paulkrush•22h ago•213 comments

Zed DeltaDB

https://zed.dev/deltadb
499•ahamez•22h ago•283 comments

Branchless Rust: Making a Filter 4x Faster by Removing an If

https://www.greyblake.com/blog/branchless-rust/
264•greyblake•3d ago•86 comments

Cloudflare OS: an open platform for agents, apps, and work

https://blog.cloudflare.com/cloudflare-os/
618•speckx•1d ago•306 comments

The 11 Types of Washington, DC, Metro Station Architecture (2018)

https://ggwash.org/view/68565/metro-has-11-types-of-station-architecture.-learn-them-all-with-thi...
39•quuxplusone•2d ago•10 comments

Morioka Shoten

https://www.takram.com/projects/a-single-room-with-a-single-book-morioka-shoten
55•skogstokig•5d ago•18 comments

Almost no skill required to cook a steak

https://blog.sydorets.com/en/posts/almost-no-skill-required-to-cook-a-steak/
80•yusyd•1h ago•84 comments

GitHub Actions and Pages are experiencing degraded availability

https://www.githubstatus.com/incidents/qcvjkzcs7j74
65•Footkerchief•1h ago•24 comments

Nvidia’s Vera Whitepaper Has a Thread Loose

https://chipsandcheese.com/p/nvidias-vera-whitepaper-has-a-thread
187•pella•19h ago•43 comments

Atlassian Rovo Exfiltrates Data, Bypassing Controls

https://www.promptarmor.com/resources/atlassian-rovo-exfiltrates-data
282•hackerBanana•23h ago•121 comments

Quantego: A Family of Lego Models of IBM Quantum Computers

https://quantego.org/
64•rbanffy•1w ago•25 comments