OptimizationAdvanced~120 min

Tiled SGEMM — Building a Mini cuBLAS

Implement single-precision general matrix multiply (SGEMM) from scratch. Progress through naive, tiled, and register-file micro-tiled kernels. Benchmark against cuBLAS.

GEMMSGEMMtilingregister-cachecuBLASoccupancy

// PROJECT PHASES

  1. 1

    Naive SGEMM

    Each thread computes one output element.

  2. 2

    Shared memory tiling

    Tile A and B into shared memory.

  3. 3

    Register micro-tiling

    Each thread computes a TM×TN sub-block.

  4. 4

    Benchmark vs cuBLAS

    Compare TFLOP/s across matrix sizes.

// SANDBOX

GPU execution
main.cu
loading editor…

// EXPECTED OUTPUT

=== 1024x1024 ===
Naive:  0.41 TFLOP/s
Tiled:  4.2  TFLOP/s

// YOUR PROGRESS

Log in to save progress

// DETAILS

Category
Optimization
Difficulty
Advanced
Est. time
~120 min
Prerequisites
1

// LEARN THE THEORY

Optimization concepts