Skip to content

LessUp/sgemm-optimization

Repository files navigation

SGEMM Optimization

CI Pages License: MIT CUDA C++

English | 简体中文

A CUDA SGEMM engineering notebook designed for both deep learning and interview presentation: from readable FP32 baselines to guarded Tensor Core WMMA, with cuBLAS-backed verification and explicit benchmark boundaries.

Why this project stands out

  • Progressive kernel ladder: naive -> tiled -> bank-conflict-free -> double-buffer -> Tensor Core.
  • Evidence-first reporting: performance claims are paired with correctness policy and scope labels.
  • Comparable interfaces: FP32 kernels share a unified (A, B, C, M, K, N, stream) launcher contract.
  • Interview-ready narrative: architecture, methodology, validation, and references reinforce one public story.
  • Bilingual mirrored docs: English and Chinese public pages stay aligned.

Quick start

git clone https://github.com/LessUp/sgemm-optimization.git
cd sgemm-optimization

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
./build/bin/sgemm_benchmark -a
ctest --test-dir build

Runtime tests and benchmarks require a CUDA-capable local machine. Hosted CI is limited to formatting, repository-structure, OpenSpec/governance, and Pages checks.

Start here (GitHub Pages)

Goal Entry point
Open English home Docs Home
Open Chinese home 中文首页
Build and run once Getting Started
Understand differentiation Architecture Overview
Prepare interview explanation Methodology
Check trust boundaries Validation Overview
Trace technical lineage References
Read normative specs OpenSpec Specs

Validation boundary

Environment What to trust
Hosted CI Formatting, docs/structure checks, OpenSpec governance, Pages buildability
Local CUDA GPU Runtime correctness verification and benchmark performance

This split is deliberate. CI keeps repository health; real GPU hardware validates runtime behavior and speed claims.

Source map

src/kernels/   CUDA SGEMM implementations
src/utils/     CUDA RAII, verification, benchmark helpers
src/main.cu    benchmark CLI
tests/         Google Test coverage against cuBLAS
docs/          learning documentation mirrored on Pages
openspec/      stable specs and change workflow

License

MIT. See LICENSE.md.