# siboehm/SGEMM_CUDA

Fast CUDA matrix multiplication from scratch

Repository: https://github.com/siboehm/SGEMM_CUDA
Canonical: https://ross.abutalabs.com/products/sgemm_cuda
Homepage: https://siboehm.com/articles/22/CUDA-MMM
Language: Cuda
License: MIT
License Family: permissive
Last push: 2025-09-02T14:42:11+00:00

## Health v2 (maintenance only)
Score: 50/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 40, release rhythm 35, longevity 99
- inputs: {"age_days": 1390, "days_push": 365, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1294, forks 212 (observed 2026-08-28T04:04:16.393231+00:00)

## What it is
An educational repository demonstrating step-by-step optimization of a CUDA SGEMM (matrix multiplication) kernel from a naive implementation to within ~94% of cuBLAS performance. It accompanies a detailed blog worklog explaining GPU performance concepts like memory coalescing, shared memory caching, and warptiling.

## Use cases
- learn how to write fast CUDA matrix multiplication kernels
- understand GPU memory coalescing and shared memory optimization
- benchmark custom CUDA kernels against cuBLAS
- study GPU performance optimization for deep learning workloads
- learn CUDA kernel autotuning and warptiling techniques

## When to choose
- you want to learn CUDA kernel optimization from first principles
- you need a worked example of optimizing matrix multiplication on NVIDIA GPUs
- you want to understand why cuBLAS is fast and what techniques it uses

## When to avoid
- you need a production matrix multiplication library - use cuBLAS instead
- you need tensor core (TF32/BF16) support, which is not covered
- you work on non-NVIDIA GPUs, since the code is CUDA-specific

## Facets
- artifact type: learning-resource
- maturity: stable
- function: benchmarking, math, gpu-computing
- domain: gpu-computing, deep-learning, performance, tutorials
- platform: cpp
- tags: cuda, sgemm, matrix-multiplication, kernel-optimization, gpgpu, educational, algorithms, linux

## Member repositories
- siboehm/SGEMM_CUDA (main) score 50

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:16.393231+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:54:06.709802+00:00, confidence not recorded.
  - readme: https://github.com/siboehm/SGEMM_CUDA (fetched 2026-08-28T04:04:16.393231+00:00, sha 64040560d1a4)
  - homepage: https://siboehm.com/articles/22/CUDA-MMM (fetched 2026-08-29T12:10:53.337130+00:00, sha 96b1f2c3c69d)
  - site_page: https://siboehm.com/about (fetched 2026-08-29T12:10:53.348041+00:00, sha b4d5838889df)
- Data as of 2026-08-30T08:39:29.467469+00:00.
