Skip to content
0:00 / 0:00

#cacheblocking#matrixmultiplication#cachelines

Performance x64: Cache Blocking (Matrix Blocking)

Creel

104K subscribers • 5 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.

Intermediate. Assumes working knowledge.

44K views9 years ago1 recommendation

Systems programmingPerformance and optimizationMemory management

An explanation of CPU cache lines and how to use cache blocking to optimize matrix multiplication performance.

In this video we'll start out talking about cache lines. After that we look at a technique called blocking. This is where we split a large problem into smaller sections, with the hopes that the data fits into cache. In reality, without my screen recorder going, blocking improves performance by about 20%. This 20% is in addition to performance increase from the previous video. At the end of this vid, the product is about 12% of the original. Support What's a Creel? on Patreon: patreon.com/whatsacreel Or support by purchasing Official merchandise: teespring.com/stores/whats-a-creel-3 FaceBook: facebook.com/whatsacreel/ Music Channel: youtube.com/channel/UC2nWRGqPL6O-Lm8mexWhISQ Another channel with random things: youtube.com/channel/UCK7bPumWNzWRnb3N8LCzKsA

Why it's here

1 person recommends this

What people say. Recommended as a great explanation of how memory layout and cache efficiency impact performance.

u/S48GSin r/GraphicsProgramming • Recommends

On “Wrote a deep dive on GPU cache hierarchy - how memory access patterns affect shader performance”

thanks for sharing I remember this video - about C++ optimization for matrix multiplications - [video re-sorting memory or preparing memory for matrix multiplication can do huge impact on performance - it probably same on GPU - for large data expecially ML I also have this blog post related to cache - Decompiling Nvidia shaders, and optimizing scroll to - Analyze and optimize neural(ML) shaders shader compiler store "const" as index to unique value - so one index per unique - means less unique is better - this how it possible to "compress" data for ML-like shaders increasing performance by 10x times

u/S48GSin r/GraphicsProgramming • Recommends

On “Cache efficient order of texels in textures? (Software real time rendering)”

…or example should the texels be indexed by swizzling the U and V coordinates like: UVUVUVUVUVUVUVUV? (256x256 texture / 8 bits per coordinate) >Or would for example the following bit order work better or equally well? UUUUUVVVVVVVVUUU (again 256x256 texture / 8 bits per coordinate) Watch this, this is not about textures but context is similar: [video [video In your case - for "best speed" you will need UVUV... and UUU...VVV... and for operation that use memory linear you use second, and for operations where you need both UV at same time you use first. It same with RGBA-colors, with matrix-operations like in video above, and with all array-like data - you will need to store data in…