22
33[ ![ CI] ( https://github.com/LessUp/sgemm-optimization/actions/workflows/ci.yml/badge.svg )] ( https://github.com/LessUp/sgemm-optimization/actions/workflows/ci.yml )
44[ ![ Pages] ( https://github.com/LessUp/sgemm-optimization/actions/workflows/pages.yml/badge.svg )] ( https://lessup.github.io/sgemm-optimization/ )
5- [ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-blue.svg )] ( LICENSE.md )
5+ [ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-blue.svg )] ( LICENSE )
66![ CUDA] ( https://img.shields.io/badge/CUDA-11.0+-76B900?logo=nvidia&logoColor=white )
77![ C++] ( https://img.shields.io/badge/C%2B%2B-17-00599C?logo=c%2B%2B&logoColor=white )
88
99English | [ 简体中文] ( README.zh-CN.md )
1010
11- Progressive CUDA SGEMM tutorial and reference implementation. The repository contains five hand-written kernel variants, cuBLAS-backed verification, a benchmark harness, and OpenSpec-governed repository rules for keeping the project compact and trustworthy .
11+ Progressive CUDA SGEMM tutorial and reference implementation, from naive kernels to Tensor Core WMMA. Includes cuBLAS-backed verification, benchmark harness, and OpenSpec-governed repository rules.
1212
1313## Why this repository exists
1414
15- - ** Show the optimization ladder clearly** : naive -> tiled -> bank-conflict-free -> double-buffered -> Tensor Core WMMA
16- - ** Stay readable** : each optimization lives in its own kernel file and keeps a consistent launch interface
17- - ** Stay verifiable** : kernels are checked against cuBLAS, with separate tolerances for FP32 and Tensor Core paths
18- - ** Stay maintainable** : the repository uses OpenSpec to keep docs, workflow, and validation rules aligned
15+ - ** Show the optimization ladder clearly** : naive → tiled → bank-conflict-free → double-buffer → Tensor Core WMMA
16+ - ** Stay readable** : each optimization lives in its own kernel file with a consistent launch interface
17+ - ** Stay verifiable** : kernels are checked against cuBLAS with separate tolerances for FP32 and Tensor Core paths
18+ - ** Stay maintainable** : OpenSpec keeps docs, workflow, and validation rules aligned
1919
20- ## Kernel progression
20+ ## Optimization ladder
2121
22- | Stage | File | Main idea |
23- | ------- | ------| -----------|
24- | Naive | ` src/kernels/naive_sgemm.cuh ` | Baseline triple-loop mapping |
25- | Tiled | ` src/kernels/tiled_sgemm.cuh ` | Shared-memory blocking |
26- | Bank-Free | ` src/kernels/bank_conflict_free_sgemm.cuh ` | ` [TILE_SIZE][TILE_SIZE+1] ` padding |
27- | Double Buffer | ` src/kernels/double_buffer_sgemm.cuh ` | Tile staging overlap and latency hiding |
28- | Tensor Core | ` src/kernels/tensor_core_sgemm.cuh ` | WMMA path with safe FP32 fallback |
22+ | Stage | Kernel | What you learn |
23+ | ------: | -------- | ----- -----------|
24+ | 1 | [ Naive ] ( docs/kernel-naive ) | Thread-to-output mapping and baseline cost |
25+ | 2 | [ Tiled ] ( docs/kernel-tiled ) | Shared-memory blocking and data reuse |
26+ | 3 | [ Bank-Free] ( docs/kernel-bank-free ) | Padding away 32-way bank conflicts |
27+ | 4 | [ Double Buffer ] ( docs/kernel-double-buffer ) | Latency hiding through staged tiles |
28+ | 5 | [ Tensor Core ] ( docs/kernel-tensor-core ) | WMMA usage with guarded FP32 fallback |
2929
3030## Quick start
3131
@@ -47,21 +47,22 @@ make benchmark
4747make test
4848```
4949
50- ## Validation model
50+ ## Where to start
5151
52- - ** Local GPU machine** : runtime tests, correctness checks, and benchmarking
53- - ** GitHub Actions** : format/style, CUDA compile validation, OpenSpec/repository checks, and Pages deployment
52+ | If you want to... | Start here |
53+ | -------------------| ------------|
54+ | Build and run once | [ Getting Started] ( docs/getting-started ) |
55+ | Learn the optimization path | [ Learning Path] ( docs/learning-path ) |
56+ | Understand repository structure | [ Architecture] ( docs/architecture ) |
57+ | See performance context | [ Benchmark Results] ( docs/benchmark-results ) |
58+ | Inspect governance rules | [ Specifications] ( specs ) |
5459
55- Standard FP32 kernels use ` rtol=1e-3 ` , ` atol=1e-4 ` . The Tensor Core path uses ` rtol=5e-2 ` , ` atol=1e-2 ` .
60+ ## Validation boundary
5661
57- ## Read next
62+ - ** Local GPU machine** : runtime tests, correctness checks, benchmarking
63+ - ** GitHub Actions** : format/style, CUDA compile, OpenSpec checks, Pages deployment
5864
59- - [ Getting Started] ( docs/getting-started.md )
60- - [ Learning Path] ( docs/learning-path.md )
61- - [ Architecture Overview] ( docs/architecture.md )
62- - [ Benchmark Notes] ( docs/benchmark-results.md )
63- - [ Specifications Index] ( specs.md )
64- - [ GitHub Pages site] ( https://lessup.github.io/sgemm-optimization/ )
65+ Standard FP32 kernels: ` rtol=1e-3 ` , ` atol=1e-4 ` . Tensor Core path: ` rtol=5e-2 ` , ` atol=1e-2 ` .
6566
6667## Repository layout
6768
7273└── main.cu # Benchmark entry point
7374tests/
7475└── test_sgemm.cu # Google Test suite
75- docs/ # Public learning -oriented documentation
76- openspec/ # Stable specs, changes, and workflow guidance
76+ docs/ # Learning -oriented documentation
77+ openspec/ # Stable specs, changes, workflow guidance
7778```
7879
79- ## Development workflow
80+ ## Project status
8081
81- Non-trivial repository changes are expected to follow:
82+ This repository is in ** archive-ready ** state. All kernel implementations are complete, tests pass, and documentation is aligned. Non-trivial changes follow the OpenSpec workflow :
8283
83- 1 . ` /opsx:explore `
84- 2 . ` /opsx:propose "description" `
85- 3 . ` /opsx:apply `
86- 4 . ` /review `
87- 5 . ` /opsx:archive `
84+ 1 . ` /opsx:explore ` — clarify scope and trade-offs
85+ 2 . ` /opsx:propose "description" ` — create change artifacts
86+ 3 . ` /opsx:apply ` — implement tasks
87+ 4 . ` /review ` — quality gate
88+ 5 . ` /opsx:archive ` — merge and close
8889
89- The stable authoritative specs live under ` openspec/specs/ ` . Active implementation plans live under ` openspec/changes/<change>/ ` .
90+ Stable specs: ` openspec/specs/ ` . Active changes: ` openspec/changes/<change>/ ` .
9091
9192## License
9293
93- MIT. See [ LICENSE.md ] ( LICENSE.md ) .
94+ MIT. See [ LICENSE] ( LICENSE ) .
0 commit comments