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?

ZCode – Harness for GLM-5.2

https://zcode.z.ai/en
319•chvid•7h ago•253 comments

Oomwoo, an open-source robot vacuum you build yourself

https://makerspet.com/blog/building-an-open-source-robot-vacuum-meet-oomwoo/
145•devicelimit•4h ago•20 comments

Senior SWE-Bench: open-source benchmark that assesses agents as senior engineers

https://senior-swe-bench.snorkel.ai/
46•matt_d•2h ago•27 comments

For first time, a cell built from scratch grows and divides

https://www.quantamagazine.org/for-the-first-time-a-cell-built-from-scratch-grows-and-divides-202...
801•defrost•15h ago•266 comments

Bring back crappy forums

https://tedium.co/2026/07/01/online-web-forums-retrospective/
120•pentagrama•3h ago•77 comments

What to learn to be a graphics programmer

https://blog.demofox.org/2026/07/01/what-to-learn-to-be-a-graphics-programmer/
288•atan2•11h ago•152 comments

Physical disc production ending in Jan 2028 for new games on PlayStation

https://blog.playstation.com/2026/07/01/physical-disc-production-ending-in-january-2028-for-new-g...
679•Tiberium•17h ago•674 comments

Opening up 'Zero-Knowledge Proof' technology to promote privacy in age assurance

https://blog.google/innovation-and-ai/technology/safety-security/opening-up-zero-knowledge-proof-...
97•consumer451•7h ago•75 comments

FFmpeg 9.1's new AAC encoder

https://hydrogenaudio.org/index.php/topic,129691.0.html
327•ledoge•15h ago•105 comments

Ask HN: Who is hiring? (July 2026)

175•whoishiring•14h ago•192 comments

The Underhanded C Contest

https://underhanded-c.org/
63•ccabraldev•7h ago•7 comments

How do wombats poop cubes?

https://www.science.org/content/article/how-do-wombats-poop-cubes-scientists-get-bottom-mystery
84•bushwart•1d ago•38 comments

Show HN: Searchable directory of 22k+ products from worker-owned co-ops

https://www.workerowned.info/
306•IESAI_ski•8h ago•63 comments

Qualcomm Linux 2.0

https://www.qualcomm.com/developer/blog/2026/06/qualcomm-linux-2-now-available
78•gilgamesh3•8h ago•27 comments

Box3D, an open source 3D physics engine

https://box2d.org/posts/2026/06/announcing-box3d/
462•makepanic•17h ago•104 comments

Learn Vim motions with an ice-cream van

https://thisismodest.com/vimscoops/
28•marcusmichaels•11h ago•3 comments

Weave Robotics launches Isaac 1, a $7,999 home robot with Fall 2026 deliveries

https://www.weaverobotics.com/isaac-1
130•ryanmerket•11h ago•177 comments

Internal Combustion Engine (2021)

https://ciechanow.ski/internal-combustion-engine/
301•StefanBatory•16h ago•84 comments

Monetization Gateway: Charge for any resource behind Cloudflare via x402

https://blog.cloudflare.com/monetization-gateway/
274•soheilpro•15h ago•190 comments

The vibration of the pager has a sound all its own

https://www.notyouremergency.com/triage-intro
13•mooreds•3d ago•1 comments

The <Usermedia> HTML Element

https://developer.chrome.com/blog/usermedia-html-element
63•twapi•5h ago•29 comments

Database Traffic Control

https://planetscale.com/blog/introducing-database-traffic-control
21•religio•1d ago•1 comments

Proliferate (YC S25) Is Hiring

https://www.ycombinator.com/companies/proliferate/jobs/mMHvKR9-founding-product-engineer
1•pablo24602•8h ago

Ask HN: Who wants to be hired? (July 2026)

119•whoishiring•14h ago•279 comments

Global review confirms mRNA vaccines are safe, effective and full of promise 

https://news.ubc.ca/2026/06/mrna-vaccines-are-safe-effective-and-full-of-promise/
265•coloneltcb•4h ago•229 comments

Why jet engines aren't made in China

https://aakash.substack.com/p/why-jet-engines-arent-made-in-china
97•paulpauper•1d ago•72 comments

Chip Off The Old Block

https://www.astralcodexten.com/p/chip-off-the-old-block
64•paulpauper•7h ago•7 comments

The Apple Disk II Controller Card (2021)

https://www.bigmessowires.com/2021/11/12/the-amazing-disk-ii-controller-card/
67•stmw•2d ago•17 comments

Healthy but sedentary people show early decline in cellular energy production

https://news.cuanschutz.edu/news-stories/healthy-but-sedentary-individuals-show-early-decline-in-...
99•littlexsparkee•6h ago•67 comments

Launch HN: Parsewise (YC P25) – Reason Across Documents with an API

50•gergelycsegzi•15h ago•47 comments