Earlier quoted context omitted.
When thermal throttling occurs you can perform faster by running slower. This is precicely because of the efficiency. The lower efficiency of the higher speed triggers a much lower performance sooner.
> When thermal throttling occurs you can perform faster by running slower. This is not true unless the throttling algorithm is so broken that it's oscillating between extremes. The parts have a curve of clock speed versus voltage. More clock speed means higher performance. That goes further up the voltage curve, meaning more power. Throttling just moves the card further down the voltage to clock speed curve. It reduc…
Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
31–40 of 60 posts
Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#32> For example, when the GPU is fully idle, nvidia-smi tells me that it’s only pulling 88W of power. I haven't used a non-laptop GPU in some time, but that is a crazy amount of "idle" power consumption. Is this normal for cards like this?
I suspect the act of running nvidia-smi itself prevents the GPU from being put into a low-power state.
Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#33Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#34> For example, when the GPU is fully idle, nvidia-smi tells me that it’s only pulling 88W of power. I haven't used a non-laptop GPU in some time, but that is a crazy amount of "idle" power consumption. Is this normal for cards like this?
Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#35I'd have guessed multiply-by-0 and multiply-by-1 can be special-cased to run much faster and simpler code paths, like you'd do when writing MUL for a processor that doesn't have it (I <3 z80)
Hardware is different. Every operation that can be performed in hardware by a chip needs dedicated circuitry. Special casing 0 and 1 means adding at least OR reduction on each operand and a dedicated multiplexer for every bit of the output. Those transistors use power even when they're not in use (leakage power is a huge issue on modern semiconductor processes). They also degrade timing by adding more gates on critical paths through the multipliers. (The timing issue here is that all operations that happen between one flip-flop and another flip-flop need to finish within one clock cycle.) And unless there are whole blocks of 0's and 1's (this does happen in certain neural networks), you typically won't see a direct speedup anyway. In software terms, the matrix multiply is scheduled as many parallel operations that cannot be accelerated much overall by skipping a few operations in some "threads."
All of this makes zero skipping a nontrivial topic. People do still try to do it but it needs serious consideration as, depending on the application, the case is rarely one-sided.
Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#36I'd have guessed multiply-by-0 and multiply-by-1 can be special-cased to run much faster and simpler code paths, like you'd do when writing MUL for a processor that doesn't have it (I <3 z80)
Hardware engineer here. Special casing the multiply by 0 and multiply by 1 paths is harder than it sounds. In software, the cost of adding special cases is simply performance. You're adding more instructions that execute in sequence on a CPU that already physically exists. Doing this for your multiply case is worthwhile because the speedup is large for 0 and 1 while the cost is not that large (relative to the time ta…
How much die space ($) will that circuitry, that's probably statistically near zero chance for you main customers workload (who has model weight of 0 or 1!?), add. And, if you can stomach the cost, what else could you put there instead?
Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#37Earlier quoted context omitted.
So I guess we'll all be applying a random rotation to our matrices now to obscure their contents, like TurboQuant does. https://arkaung.github.io/interactive-turboquant/#rotation
Not that it super matters, but random hadamards for quantization have been a thing since way before turboquant. https://arxiv.org/abs/2404.00456
Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#38Earlier quoted context omitted.
Hardware engineer here. Special casing the multiply by 0 and multiply by 1 paths is harder than it sounds. In software, the cost of adding special cases is simply performance. You're adding more instructions that execute in sequence on a CPU that already physically exists. Doing this for your multiply case is worthwhile because the speedup is large for 0 and 1 while the cost is not that large (relative to the time ta…
You didn't touch on the most important aspect for cost: die area! How much die space ($) will that circuitry, that's probably statistically near zero chance for you main customers workload (who has model weight of 0 or 1!?), add. And, if you can stomach the cost, what else could you put there instead?
Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#39I went in expecting to find 'branch prediction'[0] as the answer, but apparently things are even more complex nowadays. [0] - https://stackoverflow.com/questions/11227809/why-is-conditio...
To be fair, the culprit in the article is _less complex_ than branch prediction: "with random data, bits are flipped often, and bit flips in transistors inherently draw power" is less mental gymnastics than "with random data, the cpu fails to predict the future, causing redundant speculative execution"
Re: Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
#40Earlier quoted context omitted.
When thermal throttling occurs you can perform faster by running slower. This is precicely because of the efficiency. The lower efficiency of the higher speed triggers a much lower performance sooner.
> When thermal throttling occurs you can perform faster by running slower. This is not true unless the throttling algorithm is so broken that it's oscillating between extremes. The parts have a curve of clock speed versus voltage. More clock speed means higher performance. That goes further up the voltage curve, meaning more power. Throttling just moves the card further down the voltage to clock speed curve. It reduc…
That algorithm is doing exactly the task I described. If it could temporarily run faster but in a way that would cause occilation, that literally means it can run faster but it is choosing not to to preserve overall performance.