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?

StreetComplete on iOS is now in public beta

https://github.com/streetcomplete/StreetComplete/issues/5421
81•Snowly•1h ago•14 comments

GPT-Synopsys: Frontier Intelligence to Revolutionize Chip Design

https://news.synopsys.com/2026-09-30-OpenAI-and-Synopsys-Announce-GPT-Synopsys-Frontier-Intellige...
46•giuliomagnifico•1h ago•16 comments

OpenDLSS: A Vulkan Reimplementation of Nvidia's DLSS 5 Neural Rendering Network

https://github.com/maanHimself/OpenDLSS-NR
125•sagacity•1d ago•70 comments

Gemini 4 Argon

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-4-argon/
1454•bradleyg223•16h ago•954 comments

Returning from vacation? The government can search your phone without a warrant

https://arstechnica.com/tech-policy/2026/09/immigration-advocate-sues-border-agents-for-demanding...
39•rbanffy•1h ago•13 comments

Book of Shapes – Collection of minimal, generative and customizable SVG-patterns

https://bookofshapes.com/
106•eustoria•1d ago•7 comments

The top secret URSALA, RAQUEL, and FARRAH satellites (2025)

https://www.thespacereview.com/article/4951/1
246•Bluestein•14h ago•114 comments

Adding Floating-Point Decimals for Fun and Profit

https://blog.vero.site/post/float
15•ibobev•1d ago•1 comments

Truemetrics (YC S23) Is Hiring a GTM Founder's Associate

https://www.ycombinator.com/companies/truemetrics/jobs/THLEzXI-gtm-founder-s-associate
1•truemetricsIngo•2h ago

Why the Bronze Age Collapsed

https://www.worksinprogress.news/p/why-really-caused-the-bronze-age
282•AnodicElegy•2d ago•184 comments

Before pixels: Modular industrial dashboards

https://unsung.aresluna.org/before-pixels-modular-industrial-dashboards/
191•leephillips•17h ago•37 comments

Surprisingly complex waves reveal the brain's inner workings

https://www.quantamagazine.org/surprisingly-complex-waves-reveal-the-brains-inner-workings-20260930/
202•ibobev•17h ago•78 comments

A brief history of the Bloomberg terminal

https://spectrum.ieee.org/bloomberg-terminal
312•rbanffy•21h ago•133 comments

Launch HN: Magnitude (YC S25) – Self-optimizing inference engine for agents

https://github.com/magnitudedev/magnitude
172•anerli•18h ago•86 comments

Halfspace experimental IDE for solid modeling with distance fields

https://www.mattkeeter.com/projects/halfspace/
148•luu•16h ago•9 comments

5x faster Edge Functions: V8 isolates to Firecracker MicroVMs

https://www.netlify.com/blog/edge-functions-firecracker-microvms/
187•jbott•17h ago•84 comments

Show HN: Ledge.sh – Runnable Markdown Notes

https://ledge.sh
156•dancablam•1d ago•69 comments

The last time my family was replaced by technology

https://manuel.darcemont.fr/posts/the-last-time-my-family-was-replaced-by-technology/
265•megalomanu•23h ago•543 comments

Multi-connectivity for real-time streaming over Wi-Fi

https://nanoping.com/benchmarks/wifi-roaming
9•mortenvp•23h ago•2 comments

EDG C++ front-end goes public

https://edgcpp.org/#transition
228•iandinwoodie•16h ago•108 comments

CHOMPI portable sampler instrument is now open-source (hardware and software)

https://www.chompiclub.com/opensource
90•lashkari•18h ago•20 comments

What TLA+ can and can't check

https://buttondown.com/hillelwayne/archive/what-tla-can-and-cant-check/
198•b-man•22h ago•43 comments

Jacques Barzun, Cultural historian and critic (1980)

https://www.csmonitor.com/1980/0717/071710.html
8•Michelangelo11•1d ago•3 comments

56k.rip – the 1996 dial-up internet experience

https://56k.rip/
198•adunk•14h ago•84 comments

Doing a Machine Learning PhD While Working in Japan

https://www.tokyodev.com/articles/doing-a-machine-learning-phd-while-working-in-japan
108•pwim•1d ago•36 comments

LinkedIn Larpmaxxing

https://hereticpleb.vercel.app/blog/linkedin-larpmaxxing/
227•BurnerBurner•1d ago•186 comments

Responsible Release of AI-Generated Mathematics

https://agmai.org/general-sep29/
96•aureianimus•1d ago•130 comments

Burning Man death rates – A short lesson in statistics

https://ihavenapkinthoughts.substack.com/p/burning-man-death-rates-a-short-lesson
152•viraj_shah•2d ago•200 comments

PlayBook: A Programmable Paper Notebook [video]

https://www.youtube.com/watch?v=GurWDZ8ENpA
26•surprisetalk•1d ago•5 comments

Coltrane's Tone Circle

https://jtomschroeder.com/blog/tone-circle/
71•jtomschroeder•21h ago•19 comments