
Too many variables per thread reduces occupancy
Image: Da mocavi, CC BY-SA 4.0, via Wikimedia Commons
Too many variables per thread reduces occupancy
To minimize register pressure, programmers can optimize their code by reducing the number of variables per thread. This can be achieved by reusing variables, using local variables instead of global ones, and avoiding unnecessary variables. By doing so, programmers can increase occupancy, which can lead to better performance and efficiency of the program.
Remember this
Understanding register pressure and its impact on occupancy is crucial for optimizing program performance and efficiency.
Text adapted from Wikipedia, licensed under CC BY-SA 4.0.
instruction-level parallelism (ILP) achieves: multiple operations per clock cycle
ILP = average number of instructions per clock cycle
Von Neumann architecture
CPU must fetch both data and instructions from memory
Memory hierarchy
Memory hierarchy levels: registers → L1 → L2 → L3 → RAM → SSD → HDD (each ~10× slower)
Thread block (CUDA programming)
Thread blocks can contain up to 1024 threads as of March 2010
loop unrolling does: trades code size for reduced loop overhead
Loop unrolling optimizes execution speed by reducing loop control instructions
arithmetic intensity is
Arithmetic intensity = FLOPs / Bytes accessed
Swipe through 100 ML concepts daily
Open Pocket Polymath