Hacker News new | ask | show | jobs
by Legend2440 260 days ago
Article doesn’t mention this, but I’d consider neural networks a form of branchless programming. It’s all a bunch of multiply and threshold operations.
2 comments

> It’s all a bunch of multiply and threshold operations.

Real-world high-performance matrix multiplication functions do contain branches internally, even on GPUs. If you are ever curious about what that looks like, NVidia maintains an open-source library called CUTLASS.

Thresholding requires branching no?
No, you can do that without branching. See https://en.algorithmica.org/hpc/pipelining/branchless/#predi... for example.
As demonstrated in the article, you can compute clamp(x, min, max) with straight-line code.
No, it’s just a math operation and can be applied to any amount of data in parallel.