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

Comments

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

Size of Life

https://neal.fun/size-of-life/
1871•eatonphil•16h ago•206 comments

The Cost of a Closure in C

https://thephd.dev/the-cost-of-a-closure-in-c-c2y
23•ingve•1h ago•1 comments

Getting a Gemini API key is an exercise in frustration

https://ankursethi.com/blog/gemini-api-key-frustration/
491•speckx•12h ago•193 comments

Patterns.dev

https://www.patterns.dev/
211•handfuloflight•7h ago•50 comments

Australia begins enforcing world-first teen social media ban

https://www.reuters.com/legal/litigation/australia-social-media-ban-takes-effect-world-first-2025...
731•chirau•1d ago•1122 comments

Booting Linux in QEMU and Writing PID 1 in Go to Illustrate Kernel as Program

https://serversfor.dev/linux-inside-out/the-linux-kernel-is-just-a-program/
51•birdculture•6d ago•14 comments

Auto-grading decade-old Hacker News discussions with hindsight

https://karpathy.bearblog.dev/auto-grade-hn/
424•__rito__•15h ago•194 comments

Incomplete list of mistakes in the design of CSS

https://wiki.csswg.org/ideas/mistakes
90•OuterVale•4h ago•32 comments

How Google Maps allocates survival across London's restaurants

https://laurenleek.substack.com/p/how-google-maps-quietly-allocates
236•justincormack•1d ago•113 comments

VCMI: An open-source engine for Heroes III

https://vcmi.eu/
74•eamag•4d ago•10 comments

Flow Where You Want – Guidance for Flow Models

https://drscotthawley.github.io/blog/posts/FlowWhereYouWant.html
10•rundigen12•5d ago•1 comments

Show HN: Wirebrowser – A JavaScript debugger with breakpoint-driven heap search

https://github.com/fcavallarin/wirebrowser
18•fcavallarin•18h ago•5 comments

Python Workers redux: fast cold starts, packages, and a uv-first workflow

https://blog.cloudflare.com/python-workers-advancements/
36•dom96•2d ago•7 comments

Fossils reveal anacondas have been giants for over 12 million years

https://www.cam.ac.uk/stories/twelve-million-years-of-giant-anacondas
44•ashishgupta2209•1w ago•14 comments

Super Mario 64 for the PS1

https://github.com/malucard/sm64-psx
216•LaserDiscMan•13h ago•85 comments

How the Brain Parses Language

https://www.quantamagazine.org/the-polyglot-neuroscientist-resolving-how-the-brain-parses-languag...
5•mylifeandtimes•2d ago•1 comments

Rubio stages font coup: Times New Roman ousts Calibri

https://www.reuters.com/world/us/rubio-stages-font-coup-times-new-roman-ousts-calibri-2025-12-09/
257•italophil•1d ago•409 comments

Qwen3-Omni-Flash-2025-12-01:a next-generation native multimodal large model

https://qwen.ai/blog?id=qwen3-omni-flash-20251201
254•pretext•16h ago•91 comments

3D-printed carotid artery-on-chips for personalized thrombosis investigation

https://advanced.onlinelibrary.wiley.com/doi/10.1002/adma.202508890
20•PaulHoule•1w ago•2 comments

Show HN: Automated license plate reader coverage in the USA

https://alpranalysis.com
173•sodality2•14h ago•98 comments

When would you ever want bubblesort? (2023)

https://buttondown.com/hillelwayne/archive/when-would-you-ever-want-bubblesort/
90•atan2•10h ago•64 comments

Common Lisp, ASDF, and Quicklisp: packaging explained

https://cdegroot.com/programming/commonlisp/2025/11/26/cl-ql-asdf.html
78•todsacerdoti•21h ago•16 comments

Scientists create ultra fast memory using light

https://www.isi.edu/news/81186/scientists-create-ultra-fast-memory-using-light/
88•giuliomagnifico•6d ago•20 comments

Valve: HDMI Forum Continues to Block HDMI 2.1 for Linux

https://www.heise.de/en/news/Valve-HDMI-Forum-Continues-to-Block-HDMI-2-1-for-Linux-11107440.html
671•OsrsNeedsf2P•15h ago•361 comments

Is it a bubble?

https://www.oaktreecapital.com/insights/memo/is-it-a-bubble
223•saigrandhi•15h ago•334 comments

Gundam is just the same as Jane Austen but happens to include giant mech suits

https://eli.li/gundam-is-just-the-same-as-jane-austen-but-happens-to-include-giant-mech-suits
202•surprisetalk•1w ago•135 comments

Terrain Diffusion: A Diffusion-Based Successor to Perlin Noise

https://arxiv.org/abs/2512.08309
122•kelseyfrog•14h ago•36 comments

The future of Terraform CDK

https://github.com/hashicorp/terraform-cdk
111•mfornasa•13h ago•110 comments

Launch HN: InspectMind (YC W24) – AI agent for reviewing construction drawings

49•aakashprasad91•16h ago•45 comments

Golang's big miss on memory arenas

https://avittig.medium.com/golangs-big-miss-on-memory-arenas-f1375524cc90
130•andr3wV•1w ago•108 comments