Computer Systems Learning Sandbox

GPU Matrix Cost Visualizer

Explore GEMM, GEMV, and Gram matrix workloads with user-defined matrix shapes and data shares. Computation, communication, and memory estimates update live in browser.

Input Controls

Live updates

Standard dense matrix multiply for rectangular matrices.

1 to 1024

Matrix A and B Shapes

Auto-compatible by preset

Shapes are currently valid for multiplication.

Matrix Share Per Processor

A/B locality
Cost Model

Output Metrics

Derived Equation

-

Auto-formed from selected operation.

Output Matrix C

-

Rows x cols

Total FLOPs

-

Whole workload

Selected Model

-

-

Naive Throughput

-

GFLOP/s

Naive Memory Movement

-

-

Naive Memory Cost (Time)

-

Tiled Throughput

-

GFLOP/s

Tiled Memory Movement

-

-

Tiled Memory Cost (Time)

-

Formula Notes

Baseline system model is GEMM: A(l x m) x B(m x n) -> C(l x n).

Compute cost = 2lmn FLOPs.

Memory movement = lm + mn + ln.

Memory cost = memory movement / bandwidth + latency.

Arithmetic intensity (AI) = compute / memory movement.

For square matrices, AI = 2n/3. As n grows, workloads become more compute-bound; tiling and system scaling change effective movement, bandwidth use, and observed balance.

Roofline Time Model

Execution time vs arithmetic intensity using T_compute, T_memory, and T(AI).

T(AI) = max(T_compute, T_memory) with knee at AI = Ppeak / BW

Profiling

Browser-side update timing

Calc Time

-

Chart Draw Time

-

Total Update

-

Series Points

-

Updates

-

PCAM Lens (Quinn Michel Style Learning Prompt)

Start from GEMM baseline equations, then observe how decomposition/tiling alter effective memory movement and communication phases. Increase matrix scale to see AI rise (square case AI = 2n/3), then compare where memory-bound behavior transitions to compute-bound behavior.