Live data from Hacker News

Matrix Multiplication Inches Closer To Mythic Goal

quantamagazine.org

11–20 of 53 posts

Re: Matrix Multiplication Inches Closer To Mythic Goal

#11
post #6

Which one of these algos does Intel/Nvidia/Google use in their AVX/Cuda/TPU implementations?

Simple block partitioning, usually 4x4, with the full ordinary algorithm per block. This is the most numerically-stable and parallel. https://developer.nvidia.com/blog/cutlass-linear-algebra-cud...

and the most cache-friendly

Re: Matrix Multiplication Inches Closer To Mythic Goal

#12
Fortunately, there's another approach based on group theory that's able to hit n^2.41 and shows some promise.

Here's the paper: https://arxiv.org/abs/math/0511460

Here's a set of lecture notes that are simpler to read and give an easy example of how group theoretic methods work: http://www.ccs.neu.edu/home/viola/classes/gems-08/lectures/l...

Re: Matrix Multiplication Inches Closer To Mythic Goal

#14
post #10
post #8

Earlier quoted context omitted.

What makes you say that? I've had good speedups with Strassen multiplication in variable precision (or with floating-point, in case you meant fixed-point arithmetic).

Speed is fine. The issue is numerical stability.

Yes, indeed, and Strassen is a bad default algorithm because of this. There are specialized situations where the numerical stability isn't an issue though.

Re: Matrix Multiplication Inches Closer To Mythic Goal

#15
post #8

Earlier quoted context omitted.

What makes you say that? I've had good speedups with Strassen multiplication in variable precision (or with floating-point, in case you meant fixed-point arithmetic).

Strassen method is faster than native multiplication, but it is not stable: you will get much larger rounding errors when implementing it using floating point numbers, compared to native multipllication. And fine precision is required for a lot of algorithm implemented using matrix multiplication, such as matrix inversion or gradient descent, so this is often a problem.

do we know if the rounding errors are a big deal for numerical methods that can tolerate inaccuracy (like gradient descent for machine learning)?

Re: Matrix Multiplication Inches Closer To Mythic Goal

#17
This thought has been churning around in my mind for some years now — we focus too much on processing speed and reductions in time complexity and not enough on increasing the size and efficiency of our cache and stack.

MM (especially MM on large type numbers like e.g. hashing algorithms) are very reliant on the cache because you can’t always fit that big of a number into a register. Side note, I was reading some Abseil code last night that did some funky bit twiddling on ARM: https://github.com/abseil/abseil-cpp/blob/master/absl/hash/i...

Off the top of my head, isn’t it about 200ns [edit, not ms] to query, bus, and read something from memory? Just a thought, perhaps the cache and memory is where we should focus our efforts.

Re: Matrix Multiplication Inches Closer To Mythic Goal

#18
post #17

This thought has been churning around in my mind for some years now — we focus too much on processing speed and reductions in time complexity and not enough on increasing the size and efficiency of our cache and stack . MM (especially MM on large type numbers like e.g. hashing algorithms) are very reliant on the cache because you can’t always fit that big of a number into a register. Side note, I was reading some Abs…

[deleted]

Re: Matrix Multiplication Inches Closer To Mythic Goal

#19
post #17

This thought has been churning around in my mind for some years now — we focus too much on processing speed and reductions in time complexity and not enough on increasing the size and efficiency of our cache and stack . MM (especially MM on large type numbers like e.g. hashing algorithms) are very reliant on the cache because you can’t always fit that big of a number into a register. Side note, I was reading some Abs…

> We nevertheless stress that such improvements are only of theoretical interest, since the huge constants involved in the complexity of fast matrix multiplication usually make these algorithms impractical.

It's only for mathematical interest

Re: Matrix Multiplication Inches Closer To Mythic Goal

#20
post #17

This thought has been churning around in my mind for some years now — we focus too much on processing speed and reductions in time complexity and not enough on increasing the size and efficiency of our cache and stack . MM (especially MM on large type numbers like e.g. hashing algorithms) are very reliant on the cache because you can’t always fit that big of a number into a register. Side note, I was reading some Abs…

200ns, not 200ms
Post reply on HN