frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Faster sorting with SIMD CUDA intrinsics (2024)

https://winwang.blog/posts/bitonic-sort/
92•winwang•10mo ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•10mo 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•10mo 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•10mo 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•10mo 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•10mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•10mo 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•10mo 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•10mo 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•10mo 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•10mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•10mo ago
What are the biggest use cases of GPU accelerated sorting?

A Decade of Slug

https://terathon.com/blog/decade-slug.html
307•mwkaufma•3h ago•23 comments

Python 3.15's JIT is now back on track

https://fidget-spinner.github.io/posts/jit-on-track.html
170•guidoiaquinti•3h ago•55 comments

Get Shit Done: A Meta-Prompting, Context Engineering and Spec-Driven Dev System

https://github.com/gsd-build/get-shit-done
100•stefankuehnel•1h ago•45 comments

Microsoft's 'unhackable' Xbox One has been hacked by 'Bliss'

https://www.tomshardware.com/video-games/console-gaming/microsofts-unhackable-xbox-one-has-been-h...
438•crtasm•7h ago•173 comments

It Took Me 30 Years to Solve This VFX Problem – Green Screen Problem [video]

https://www.youtube.com/watch?v=3Ploi723hg4
107•yincrash•4d ago•43 comments

Kagi Small Web

https://kagi.com/smallweb/
653•trueduke•12h ago•187 comments

Launch HN: Kita (YC W26) – Automate credit review in emerging markets

8•rheamalhotra1•2h ago•0 comments

Warranty Void If Regenerated

https://nearzero.software/p/warranty-void-if-regenerated
20•Stwerner•1h ago•0 comments

Edge.js: Run Node apps inside a WebAssembly sandbox

https://wasmer.io/posts/edgejs-safe-nodejs-using-wasm-sandbox
64•syrusakbary•4h ago•20 comments

Torturing Rustc by Emulating HKTs

https://www.harudagondi.space/blog/torturing-rustc-by-emulating-hkts/
28•g0xA52A2A•3d ago•3 comments

Node.js needs a virtual file system

https://blog.platformatic.dev/why-nodejs-needs-a-virtual-file-system
209•voctor•7h ago•154 comments

'The Secret Agent': Exploring a Vibrant, yet Violent Brazil (2025)

https://theasc.com/articles/the-secret-agent-cinematography
104•tambourine_man•6h ago•44 comments

Chrome extension adjusts video speed based on how fast the speaker is talking

https://github.com/ywong137/speech-speed
43•MrBuddyCasino•4d ago•9 comments

Meta Horizon Worlds on Meta Quest is being discontinued

https://communityforums.atmeta.com/blog/AnnouncementsBlog/updates-to-your-meta-quest-experience-i...
118•par•3h ago•119 comments

Unsloth Studio

https://unsloth.ai/docs/new/studio
86•brainless•6h ago•20 comments

Illinois Introducing Operating System Account Age Bill

https://www.ilga.gov/Legislation/BillStatus?DocTypeID=HB&DocNum=5511
202•terminalbraid•4h ago•278 comments

Spice Data (YC S19) Is Hiring a Product Specialist

https://www.ycombinator.com/companies/spice-data/jobs/P0e9MKz-product-specialist-new-grad
1•richard_pepper•5h ago

Java 26 is here

https://hanno.codes/2026/03/17/java-26-is-here/
116•mfiguiere•3h ago•80 comments

Meta and TikTok let harmful content rise to drove engagement, say whistleblowers

https://www.bbc.com/news/articles/cqj9kgxqjwjo
103•1vuio0pswjnm7•1h ago•47 comments

OpenSUSE Kalpa

https://kalpadesktop.org/
117•ogogmad•8h ago•72 comments

Ryugu asteroid samples contain all DNA and RNA building blocks

https://phys.org/news/2026-03-ryugu-asteroid-samples-dna-rna.html
150•bookofjoe•10h ago•90 comments

Show HN: Crust – A CLI framework for TypeScript and Bun

https://github.com/chenxin-yan/crust
55•jellyotsiro•17h ago•23 comments

Finding a CPU Design Bug in the Xbox 360 (2018)

https://randomascii.wordpress.com/2018/01/07/finding-a-cpu-design-bug-in-the-xbox-360/
143•mariuz•4d ago•45 comments

Honda is killing its EVs

https://techcrunch.com/2026/03/14/honda-is-killing-its-evs-and-any-chance-of-competing-in-the-fut...
128•sylvainkalache•2d ago•206 comments

Toward automated verification of unreviewed AI-generated code

https://peterlavigne.com/writing/verifying-ai-generated-code
73•peterlavigne•1d ago•64 comments

FFmpeg 8.1

https://ffmpeg.org/index.html#pr8.1
318•gyan•7h ago•49 comments

Show HN: Horizon – GPU-accelerated infinite-canvas terminal in Rust

https://github.com/peters/horizon
28•petersunde•4h ago•14 comments

The Plumbing of Everyday Magic

https://plumbing-of-everyday-magic.hyperclay.com/
33•hannahilea•4d ago•2 comments

Reverse-engineering Viktor and making it open source

https://matijacniacki.com/blog/openviktor
146•zggf•14h ago•62 comments

Show HN: Antfly: Distributed, Multimodal Search and Memory and Graphs in Go

https://github.com/antflydb/antfly
74•kingcauchy•6h ago•27 comments