---
title: Problem set 9
heading: "Problem set 9: datacenters, accelerators, near-data computing and dependability"
eyebrow: S4 · Problem set 9
type: problems
---

::: hook
These problems use lessons 39 to 49: warehouse-scale computers, domain-specific accelerators, near-data computing, the accelerator lab, dependability, storage and queueing, performance evaluation and the queueing lab. Take a year as 8760 hours.
:::

::: pool
pick: 12

::: check
kind: parts
given: m = 0.5 | 0.8; s = 4 | 16; o = 0.03 | 0.08

## A kernel spends {m} of its time moving data; near-memory logic makes that {s} times faster at an overhead of {o} of the original time.

::: part
answer: 1/((1 - m) + m/s + o)
tolerance: 0.5%

### What speedup results?

::: misses
- [any] $1/((1 - m) + m/s + o)$.
:::
:::

::: part
answer: 1/((1 - m) + o)
tolerance: 0.5%

### What is the most any speedup of data movement gives?

::: misses
- [any] Let s grow without bound.
:::
:::
:::

::: check
kind: parts
given: n = 128 | 256; t = 50 | 200; E = 2 | 8

## A resistive crossbar of {n} × {n} cells does one matrix-vector product every {t} ns for {E} nJ.

::: part
answer: n^2/(t*1e-9)/1e12
unit: TMAC/s
tolerance: 0.5%

### What multiply-accumulate rate is that?

::: misses
- [any] $n^2/t$.
:::
:::

::: part
answer: E*1e-9/n^2*1e15
unit: fJ
tolerance: 0.5%

### What does each multiply-accumulate cost?

::: misses
- [any] Energy over $n^2$.
:::
:::
:::

::: check
kind: parts
given: M = 64 | 512 | 2048; K = 256 | 512; N = 256 | 1000; n = 128 | 256

## An {M} × {K} by {K} × {N} matrix multiply runs on an {n} × {n} weight-stationary array (n cycles to load a tile, then M + 2(n − 1) to stream).

::: part
answer: ceil(K/n - 1e-9)*ceil(N/n - 1e-9)*(n + M + 2*(n - 1))
unit: cycles
tolerance: 0

### How many cycles does it take?

::: misses
- [any] Tiles × (load + stream + fill and drain).
:::
:::

::: part
answer: M*K*N/(n^2*ceil(K/n - 1e-9)*ceil(N/n - 1e-9)*(n + M + 2*(n - 1)))*100
unit: %
tolerance: 0.5%

### What utilization is that?

::: misses
- [any] Useful MACs over $n^2$ × cycles.
:::
:::
:::

::: check
kind: parts
given: r = 32 | 48 | 64 | 96; T = 128 | 256; let x = floor(65536/(r*T)); let y = floor(2048/T)

## A GPU SM has 65 536 registers and 64 warp slots. A kernel uses {r} registers per thread in blocks of {T} threads (shared memory isn't the limit).

::: part
answer: x - (x - y)*step(x - y)
unit: blocks
tolerance: 0

### How many blocks fit?

::: misses
- [any] The smaller of the register limit and the warp-slot limit.
:::
:::

::: part
answer: (x - (x - y)*step(x - y))*T/32/64*100
unit: %
tolerance: 0.5%

### What occupancy is that?

::: misses
- [any] Resident warps over 64.
:::
:::
:::

::: check
kind: parts
given: P = 1000 | 20000; B = 100 | 2000; W = 1 | 100; Q = 1 | 10

## A machine peaks at {P} GFLOP/s with {B} GB/s; a kernel does {W} G operations and moves {Q} GB.

::: part
answer: W/Q*B - (W/Q*B - P)*step(W/Q*B - P)
unit: GFLOP/s
tolerance: 0.5%

### What rate does it attain?

::: misses
- [any] $\min(P, BI)$ with $I = W/Q$.
:::
:::

::: part
answer: W/(W/Q*B - (W/Q*B - P)*step(W/Q*B - P))
unit: s
tolerance: 0.5%

### How long does it take?

::: misses
- [any] Operations over the attained rate.
:::
:::
:::

::: check
kind: parts
given: k = 50 | 200 | 1000; p = 0.002 | 0.01

## A request fans out to {k} leaves, each slow with probability {p}; hedging sends each leaf request to two independent replicas.

::: part
answer: (1 - (1 - p)^k)*100
unit: %
tolerance: 0.5%

### What fraction of requests are slow without hedging?

::: misses
- [any] $1 - (1 - p)^k$.
:::
:::

::: part
answer: (1 - (1 - p^2)^k)*100
unit: %
tolerance: 0.5%

### And with hedging?

::: misses
- [any] A leaf is slow only if both replicas are: $p^2$.
:::
:::
:::

::: check
kind: parts
given: S = 2 | 10; a = 0.5 | 0.7; b = 0.85 | 0.95

## A server takes {S} ms per request (M/M/1); its load rises from {a} to {b} utilization.

::: part
answer: S/(1 - a)
unit: ms
tolerance: 0.5%

### What is the mean response time before?

::: misses
- [any] $S/(1 - \rho)$.
:::
:::

::: part
answer: (1 - a)/(1 - b)
tolerance: 0.5%

### By what factor does it grow?

::: misses
- [b/a] Response time goes as $1/(1 - \rho)$, not as ρ.
- [any] $(1 - \rho_1)/(1 - \rho_2)$.
:::
:::
:::

::: check
kind: parts
given: l = 1000 | 20000; T = 5 | 40

## A service receives {l} requests a second, and each spends {T} ms inside it.

::: part
answer: l*T/1000
unit: requests
tolerance: 0.5%

### How many requests are inside at once on average?

::: misses
- [any] Little's law: $L = \lambda T$.
:::
:::
:::

::: check
kind: parts
given: u = 0.01 | 0.001; k = 2 | 3; q = 0.0001 | 0.00002

## A service needs a front end (unavailable {q} of the time) in series with any one of {k} independent replicas, each unavailable {u} of the time.

::: part
answer: (1 - (1 - q)*(1 - u^k))*100
unit: %
tolerance: 0.5%

### What fraction of the time is the service down?

::: misses
- [(q + u)*100] Replicas fail together only with probability $u^k$.
- [any] $1 - (1 - q)(1 - u^k)$.
:::
:::

::: part
answer: (1 - (1 - q)*(1 - u^k))*525600
unit: minutes
tolerance: 0.5%

### How much downtime is that per year?

::: misses
- [any] Unavailability × minutes in a year.
:::
:::
:::

::: check
kind: parts
given: M = 500000 | 1000000; N = 6 | 8 | 12; R = 24 | 72

## A disk array has {N} disks with an MTTF of {M} hours and a {R}-hour rebuild.

::: part
answer: M^2/(N*(N - 1)*R)/8760
unit: years
tolerance: 0.5%

### What MTTDL does RAID 5 give?

::: misses
- [any] $M^2/(N(N - 1)R)$.
:::
:::

::: part
answer: M^3/(N*(N - 1)*(N - 2)*R^2)/8760
unit: years
tolerance: 0.5%

### And RAID 6, by the analogous $M^3/(N(N - 1)(N - 2)R^2)$?

::: misses
- [any] A third failure must land in the double-repair window.
:::
:::
:::

::: check
kind: parts
given: c = 3000 | 8000; y = 3 | 5; p = 300 | 500; u = 0.3 | 0.6; e = 60 | 120; E = 1.1 | 1.4

## A server costs {c} dollars, amortized over {y} years; it peaks at {p} W, idles at half that, and runs at {u} utilization in a facility with PUE {E}, paying {e} dollars per MWh.

::: part
answer: c/(y*12)
tolerance: 0.5%

### What does the server cost per month, in dollars?

::: misses
- [any] Price over months.
:::
:::

::: part
answer: (p/2 + p/2*u)*E*730/1e6*e
tolerance: 0.5%

### What does its electricity cost per month, in dollars (730 hours)?

::: misses
- [any] Power × PUE × hours × price.
:::
:::
:::

::: check
kind: parts
given: i = 0.3 | 0.5 | 0.6; u = 0.1 | 0.3 | 0.5

## A server's idle power is {i} of its peak; it runs at {u} utilization.

::: part
answer: (i + (1 - i)*u)*100
unit: %
tolerance: 0.5%

### What fraction of peak power does it draw?

::: misses
- [any] $i + (1 - i)u$.
:::
:::

::: part
answer: u/(i + (1 - i)*u)*100
unit: %
tolerance: 0.5%

### What is its energy efficiency, relative to running at full load?

::: misses
- [any] Work fraction over power fraction.
:::
:::
:::

::: check
kind: parts
given: C = 0.5 | 2 | 8; P = 600 | 3000; w = 2 | 4; h = 50 | 500

## An SSD holds {C} TB; its cells endure {P} program/erase cycles, write amplification is {w}, and the host writes {h} GB a day.

::: part
answer: C*1000*P/(w*h)/365
unit: years
tolerance: 0.5%

### How long does it last?

::: misses
- [C*1000*P/h/365] Write amplification divides the life.
- [any] $CP/(wh)$.
:::
:::

::: part
answer: h/(C*1000)
tolerance: 0.5%

### How many full drive writes a day is the host load?

::: misses
- [any] Daily writes over capacity.
:::
:::
:::

::: check
kind: parts
given: v = 0.3 | 0.6 | 1; e = 0.01 | 0.03; z = 1.96 | 3; U = 1000 | 10000; r = 1e5 | 1e6

## A sampled simulation estimates CPI (coefficient of variation {v}) within {e} at z = {z}; each sample runs {U} instructions in detail at {r} instructions a second.

::: part
answer: (z*v/e)^2
unit: samples
tolerance: 0.5%

### How many samples does it need?

::: misses
- [any] $(z\,\text{CoV}/\varepsilon)^2$.
:::
:::

::: part
answer: (z*v/e)^2*U/r
unit: s
tolerance: 0.5%

### How long does the detailed part take?

::: misses
- [any] Samples × sample length ÷ rate.
:::
:::
:::
:::
