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?

Carnegie Mellon is putting computer science courses on YouTube for free

https://www.cs.cmu.edu/learn/
576•pcompeau•4h ago•93 comments

Windows 11 Is Collecting Data on Which Coding Agents and Developer Tools You Use

https://xusheng.dev/posts/windows-coding-agent-telemetry/
131•cwaffles•1h ago•55 comments

BugMeNot has closed

https://www.bugmenot.com/
266•lode•3h ago•143 comments

World's Largest Brands Infected With Malware Via Optimizely

https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/
156•martinald•3h ago•28 comments

How to Break into Security, Ptacek Edition (2012)

https://krebsonsecurity.com/2012/06/how-to-break-into-security-ptacek-edition/
64•ronfriedhaber•2h ago•16 comments

OpenCode Browse

https://opencode.ai/product/browse
93•mfiguiere•3h ago•42 comments

Optimizely Compromised, Served Malware on Zoom, GitLab

https://blog.report-uri.com/worlds-largest-brands-infected-with-malware-via-optimizely/
51•kristjansson•1h ago•15 comments

Chemistry is Actually Geometry

https://chillphysicsenjoyer.substack.com/p/chemistry-is-actually-geometry
83•sebg•4h ago•20 comments

Grazing sheep in fields with solar arrays

https://news.cornell.edu/stories/2026/10/sheep-grazing-solar-fields-offers-farmers-economic-ecolo...
204•PaulHoule•7h ago•202 comments

Jiff 1.0: A datetime library for Rust

https://burntsushi.net/jiff/
293•burntsushi•7h ago•71 comments

Frame – 31.5" color ePaper display

https://trmnl.com/blog/introducing-frame
280•geerlingguy•8h ago•200 comments

Technical issue at JPMorgan Chase triggers online banking delays for US banks

https://apnews.com/article/bank-outage-chase-wells-fargo-truist-50fee2693c22f597fa6ca51a97ef2cda
700•samk3nny•6h ago•578 comments

Formal Verification Is Not Verifiable

https://alperenkeles.com/posts/formal-verification-is-not-verifiable/
41•zdw•2d ago•5 comments

Rust changed me as a developer

https://blog.startifact.com/posts/how-rust-changed-me/
169•speckx•4h ago•105 comments

Do Repeat Yourself

https://arcentry.com/blog/do-repeat-yourself/
13•max_sendfeld•12h ago•0 comments

Show HN: Sutra-OS – A self-hosted ontology platform

https://github.com/0nelight/sutra-os
19•0nelight•1h ago•3 comments

Squircles

https://linebender.org/wiki/curves/squircle/
117•raphlinus•16h ago•36 comments

Launch HN: Axonnic (YC F26) – Sleeves that track fingers and estimate force

25•arshpatankar•4h ago•10 comments

United Airlines experiencing a widespread system outage, airline says

https://www.cnn.com/2026/11/16/us/united-airlines-outage
147•bearsyankees•2h ago•69 comments

Spamhaus new email sender requirements in November

https://www.spamhaus.org/sender-guidelines/
65•computer23•2h ago•50 comments

My Quest to push native Three.js quality match AAA Game Engines

https://ben3d.ca/blog/building-the-aaa-lighting-pipeline-in-threejs
83•bhouston•3h ago•33 comments

Microsoft blames monster email outage on software defect introduced in July fix

https://www.theregister.com/saas/2026/11/16/microsoft-blames-monster-email-outage-on-software-def...
201•Bender•11h ago•140 comments

The Secret ThinkPad Powerbutton Code to Bring Dead Laptops Back to Life (2007)

https://masnick.com/posts/the-secret-thinkpad-powerbutton-code-to-bring-dead-laptops-back-to-life/
294•sammatilda•13h ago•115 comments

Michael Mann's 'Heat' Copyright Fight Turns on a Deal with Himself

https://copyrightlately.com/michael-mann-heat-copyright-termination/
86•speckx•6h ago•38 comments

How to Intercept HTTP/3 Traffic: QUIC and Qpack

https://interceptsuite.com/blog/intercept-http3-traffic-quic-qpack-explained/
53•anof-cyber•5h ago•4 comments

Aristotle Expands into Rust

https://www.harmonic.fun/news/aristotle-rust-verification/
99•maufl•7h ago•49 comments

Many of Amazon’s Black Friday and Cyber Monday “deals” offered no savings

http://groundworkcollaborative.org/news/amazons-decoy-deals-groundwork-investigation-reveals-near...
821•DeepLogin•11h ago•500 comments

Jolt – Clojure that speaks C

https://jolt-lang.net/
91•michaelsbradley•8h ago•28 comments

Strengthening the fight against online child sexual abuse

https://openai.com/index/strengthening-online-child-safety/
100•rossant•6h ago•217 comments

The origins of the placenta

https://www.caltech.edu/about/news/uncovering-the-hidden-origins-of-the-placenta
29•gmays•3d ago•6 comments