Lightweight FastAPI app that serves a single-page frontend for exploring compute, communication, and memory behavior in parallel linear algebra workloads.
- Install dependencies:
pip install -r requirements.txt
- Start the app:
uvicorn main:app --reload
- Open:
- All cost calculations are done in the browser (
static/app.js). - FastAPI is only used to serve static files.
- Includes operation presets for
GEMM,GEMV, andGram (A^T A). - Users can set matrix shapes for
AandB, data share ofA/Bper processor, and processor countp. - App auto-derives output matrix
Cand updates FLOPs, communication cost, and memory cost in real time. - Visualization uses a single roofline-derived time plot vs arithmetic intensity.
- Built-in profiling shows frontend calculation and chart update timings per interaction.
- Graphs use arithmetic intensity (
FLOPs / bytes moved) as the common x-axis. - Memory cost is modeled as time:
bytes moved / bandwidth + latency terms. - Throughput metrics are shown in
GFLOP/s. - Includes implementation profiles for
NumPy,CUDA Kernel, andcuBLAS. - Includes GPU presets (
NVIDIA Hopper H100,NVIDIA Blackwell B200,A100,RTX 4090) plusCustom. - Roofline time model curves:
T_compute = FLOPs / P_peak(horizontal)T_memory = FLOPs / (AI * BW)(decreasing)T(AI) = max(T_compute, T_memory)with knee atAI = P_peak / BW
- Baseline GEMM formulas used in notes:
- Compute cost:
2lmnFLOPs - Memory movement:
lm + mn + ln(elements, then scaled by bytes/element) - Memory cost (time):
memory movement / bandwidth + latency - Arithmetic intensity:
AI = compute / memory movement - Square GEMM scaling: for
l = m = n,AI = (2n^3)/(3n^2) = 2n/3(grows linearly withn)
- Compute cost:
- Computation pipeline in code:
- Derive baseline
l, m, nfrom selected operation (GEMM,GEMV,Gram) and compute baseline terms first. - Expand baseline with matrix-share and algorithm effects:
- Share-adjusted movement:
(1-shareA)lm + (1-shareB)mn + ln - Naive/tiled overhead terms layered on top of baseline movement
- Share-adjusted movement:
- Apply hardware/program limits to map FLOPs and movement into execution time.
- Derive baseline