NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
85.3 GFlops: Optimizing FP32 Matrix Multiplication on a Single AMD Zen 3 Core (github.com)
gitowiec 4 hours ago [-]
What's the language? My Firefox detected it as English, I suppose it is because of lang=en in HTML
pdpi 4 hours ago [-]
Brazilian Portuguese.

Funnily enough, it took me a while to determine it was definitely Brazilian Portuguese, given I'm a native Portuguese speaker, because the whole thing is written in a stiff academic-ish style that hides some the differences between European and Brazilian Portuguese.

pezezin 2 minutes ago [-]
I grew up in Spain close to the border with Portugal, so even though I don't speak the language (something which I really regret) I am familiar with it. What are the major differences between European and Brazilian Portuguese? I only know that Brazilians use the gerund like us Spanish speakers, whereas European Portuguese uses "estar a" + infinitive.
embedding-shape 3 hours ago [-]
> My Firefox detected it as English

Try selecting some text in the README, and right-clicking then "Translate to ..." and the autodetect might do a bit better to identify the language.

kzrdude 4 hours ago [-]
Looks like Portuguese to me (I don't speak it)
homarp 4 hours ago [-]
email at the bottom has .br so it's Brazilian Portuguese (https://en.wikipedia.org/wiki/Brazilian_Portuguese )
adrian_b 3 hours ago [-]
What is interesting here is that this is an optimization study, whose goal was to determine the optimum implementation variant for matrix multiplication on a Zen 3 CPU.

It is likely that a similar optimization strategy would work for a modern Zen 5, though some of the parameters for the optimum variant would probably have double values, because Zen 5 has twice more registers, each double in size, and it can process and transfer a double number of FP32 per clock cycle.

The value given by the author of 63.5% of the theoretical maximum throughput, is likely to be pessimistic, because when doing heavy computations the clock frequency of the CPU will drop, so the actual efficiency might be higher, e.g. perhaps of 70% to 80% of the theoretical maximum throughput at that clock frequency.

The ATLAS BLAS-compatible library attempted to perform automatically such an optimization for its host computer, but I have not studied it to see whether its optimization methods would still work on modern CPUs with AVX+FMA or with AVX-512.

devy 3 hours ago [-]
[flagged]
Razengan 3 hours ago [-]
Could alternative CPU architectures like ternary/quaternary and/or analog etc be better at matrix multiplication?
entropicdrifter 2 hours ago [-]
Analog is certainly better, so long as you're OK with some noise.
ranger_danger 4 hours ago [-]
For comparison, the best performing GPUs today can do FP32 at > 100 TFLOP/s
pixelpoet 4 hours ago [-]
Zen3 isn't the best performing CPU today, though of course it'll never approach GPU level (which is pretty much ASIC level for matrix muls with special units). CPUs are getting dedicated "AI accelerators" too so it'd be interesting to compare per watt. The real limit is almost certainly memory bandwidth, not flops.

It would also be very interesting to see someone like Fabien Giesen / ryg do a maxed out AVX512 version for Zen5. His code's so fast it makes Intel 13900k's self destruct.

zzzoom 3 hours ago [-]
Matrix multiplication is one of the few operations that isn't regularly limited by memory bandwidth. BLAS implementations come with several heavily optimized, architecture-specific versions of sgemm.
adrian_b 4 hours ago [-]
The throughput quoted here is for a single core, and it is not reported any attempt to measure how well this scales to all cores.

A modern Zen 5 should reach a throughput more than twice this value per core, with a total over 3 TFLOP/s for the complete CPU.

That 100 TFLOP/s for FP32 is for a GPU that might cost from 30 to 100 times more than a desktop CPU, so it is not certain that its performance per dollar is any better than for the desktop CPU.

This is very different from 7 to 10 years ago, when GPUs had a far higher performance per dollar than any CPUs. Since then, the performance per dollar of the desktop CPUs has increased, mainly because their prices have not increased much, while the performance per dollar of the GPUs has decreased, mainly because of a great increase in their prices, especially for the "datacenter" GPUs, which now may be more than 10 times more expensive than they were 7 years ago.

zamadatix 3 hours ago [-]
Certainly not in a single core (however the given GPU wishes to define it)? This comparison would seem more apt to the largest multi-core CPU results.
houslast 3 days ago [-]
Pushing the Limits of AMD Zen 3: Achieving 85.3 GFLOPS on a Single Core! I recently took on the challenge of squeezing every drop of performance out of a single AMD Zen 3 core, successfully reaching a blazing-fast 85.3 GFLOPS in FP32 matrix multiplication. By diving deep into low-level software optimization—focusing on advanced SIMD vectorization, strict cache management, and instruction pipelining—I managed to maximize CPU efficiency without relying on multi-threading. This project serves as a powerful proof of concept for high-performance computing (HPC) enthusiasts, proving that deeply optimized code can still unlock incredible hidden potential in modern silicon.
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 00:25:13 GMT+0000 (Coordinated Universal Time) with Vercel.