Assignment 6: Resource-driven modeling, energy to solution, EDP (due June 17 11:59 p.m.)
Completion requirements
Opened: Thursday, 9 June 2022, 12:00 AM
Due: Saturday, 18 June 2022, 12:00 AM
- Resource-driven modeling.
There are two fundamental bottlenecks that govern the runtime of a loop
on a CPU chip: memory data transfer and instruction execution. Based on
this insight, we can construct a simple model for the runtime of a loop
.
Assume a loop of length \(N\) that requires \(V\) bytes of data to/from memory and performs \(W\) instructions, both per iteration. The CPU has a memory bandwidth of \(b_S\) (in bytes/s) and a peak execution capability of \(p_E\) (in instructions per cycle). The clock frequency is \(f\). Assume that memory transfers and instruction execution are the only relevant resources. Also assume that fetching the instructions from memory comes at no cost (because they all fit into the L1 instruction cache).
(a) (10 crd) Calculate the expected execution time of the loop in cycles per iteration, assuming that execution and data transfer cannot overlap.
(b) (10 crd) How does your answer to (a) change if you assume that there is full overlap between execution and data transfer?
(c) (20 crd) Construct a model for the execution performance (instructions per second) from cases (a) and (b). - Measuring energy to solution and energy-delay product.
The likwid-perfctr tool also allows to measure the energy needed to execute the code. This can be done, e.g., using the ENERGY metric group or the MEM_DP/MEM_SP groups. The energy used by the CPU and the DRAM is listed in the summary box at the end of the likwid-perfctr output. Use your code from the previous assignment to explore the energy consumption of the serial Schönauer triad loop.
(a) How much energy (in Joules) does one traversal of the kernel need on the CPU and on the DRAM when running in Turbo mode? (N=108) (10 crd)
(b) How do these energy values depend on the clock frequency of the CPU? Run the benchmark with 1.2, 1.3, ..., 2.4 GHz and make a plot of DRAM and CPU energy consumption per loop traversal vs. frequency. Make sure that the frequency setting is correct by measuring it! (25 crd)
(c) Make a plot of the energy-delay product (EDP), i.e., the product of CPU+DRAM energy to solution and execution time per loop traversal, vs. clock frequency. Discuss why the EDP may be a better metric for energy efficiency than energy to solution alone. (25 crd)