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•9mo ago
Code at https://github.com/wiwa/blog-code/

Comments

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

Mac mini will be made at a new facility in Houston

https://www.apple.com/newsroom/2026/02/apple-accelerates-us-manufacturing-with-mac-mini-production/
78•haunter•43m ago•50 comments

Looks like it is happening

https://www.math.columbia.edu/~woit/wordpress/?p=15500
50•jjgreen•38m ago•19 comments

I'm helping my dog vibe code games

https://www.calebleak.com/posts/dog-game/
457•cleak•4h ago•136 comments

Hacking an old Kindle to display bus arrival times

https://www.mariannefeng.com/portfolio/kindle/
86•mengchengfeng•2h ago•17 comments

Nearby Glasses

https://github.com/yjeanrenaud/yj_nearbyglasses
150•zingerlio•4h ago•59 comments

Show HN: Emdash – Open-source agentic development environment

https://github.com/generalaction/emdash
62•onecommit•3h ago•28 comments

HuggingFace Agent Skills

https://github.com/huggingface/skills
102•armcat•4h ago•34 comments

I pitched a roller coaster to Disneyland at age 10 in 1978

https://wordglyph.xyz/one-piece-at-a-time
361•wordglyph•8h ago•133 comments

Manjaro website off-line again due to lapsed certificate

https://distrowatch.com/dwres.php?resource=showheadline&story=20140
34•hexagonsuns•2h ago•11 comments

How we rebuilt Next.js with AI in one week

https://blog.cloudflare.com/vinext/
79•ghostwriternr•1h ago•10 comments

Show HN: Recursively apply patterns for pathfinding

https://pattern-pathfinder.vercel.app/?fixtureId=%7B%22path%22%3A%22site%2Fexamples%2F_intro.fixt...
3•seveibar•6m ago•0 comments

Steel Bank Common Lisp

https://www.sbcl.org/
104•tosh•3h ago•29 comments

IRS Tactics Against Meta Open a New Front in the Corporate Tax Fight

https://www.nytimes.com/2026/02/24/business/irs-meta-corporate-taxes.html
165•mitchbob•8h ago•179 comments

Build Your Own Forth Interpreter

https://codingchallenges.fyi/challenges/challenge-forth/
23•AlexeyBrin•3d ago•6 comments

We installed a single turnstile to feel secure

https://idiallo.com/blog/installed-single-turnstile-for-security-theater
236•firefoxd•2d ago•98 comments

Verge (YC S15) Is Hiring a Director of Computational Biology and AI Scientists/Eng

https://jobs.ashbyhq.com/verge-genomics
1•alicexzhang•4h ago

Diode – Build, program, and simulate hardware

https://www.withdiode.com/
423•rossant•3d ago•92 comments

Show HN: Chaos Monkey but for Audio Video Testing (WebRTC and UDP)

https://github.com/MdSadiqMd/AV-Chaos-Monkey
20•MdSadiqMd•1d ago•2 comments

Variable interpolatable smooth curves and outlines

https://thottingal.in/blog/2026/02/20/var-interpolatable-smooth-curves/
5•sthottingal•4d ago•0 comments

Extending C with Prolog (1994)

https://www.amzi.com/articles/irq_expert_system.htm
51•Antibabelic•2d ago•17 comments

IDF killed Gaza aid workers at point blank range in 2025 massacre: Report

https://www.dropsitenews.com/p/israeli-soldiers-tel-sultan-gaza-red-crescent-civil-defense-massac...
839•Qem•9h ago•194 comments

Osaka: Kansai Airport proud to have never lost single piece of luggage (2024)

https://japannews.yomiuri.co.jp/features/japan-focus/20241228-229891/
188•thunderbong•5h ago•75 comments

Open Letter to Google on Mandatory Developer Registration for App Distribution

https://keepandroidopen.org/open-letter/
298•kaplun•4h ago•238 comments

λProlog: Logic programming in higher-order logic

https://www.lix.polytechnique.fr/Labo/Dale.Miller/lProlog/
131•ux266478•3d ago•35 comments

The Missing Semester of Your CS Education – Revised for 2026

https://missing.csail.mit.edu/
348•anishathalye•1d ago•106 comments

Why High FOV Sucks – Fixing It with Panini Projection

https://www.youtube.com/watch?v=LE9kxUQ-l14
26•Eduard•1h ago•8 comments

Samsung Upcycle Promise

https://www.xda-developers.com/samsung-promised-make-old-phones-useful-galaxy-upcycle/
157•1970-01-01•1d ago•93 comments

OpenAI, the US government and Persona built an identity surveillance machine

https://vmfunc.re/blog/persona/
358•rzk•3h ago•110 comments

Goodbye InnerHTML, Hello SetHTML: Stronger XSS Protection in Firefox 148

https://hacks.mozilla.org/2026/02/goodbye-innerhtml-hello-sethtml-stronger-xss-protection-in-fire...
309•todsacerdoti•8h ago•142 comments

Denver dumps Flock, awards contract to Axon

https://www.9news.com/article/news/local/denver-removing-flock-cameras-new-axon-contract/73-640b5...
98•therobots927•4h ago•35 comments