# Liu-xiandong/How_to_optimize_in_GPU

This is a series of GPU optimization topics. Here we will introduce  how to optimize the CUDA kernel in detail.  I will introduce several basic kernel optimizations, including: elementwise, reduce, sgemv, sgemm, etc. The performance of these kernels is basically at or near the theoretical limit.

Repository: https://github.com/Liu-xiandong/How_to_optimize_in_GPU
Canonical: https://ross.abutalabs.com/products/how_to_optimize_in_gpu
Language: Cuda
License: Apache-2.0
License Family: permissive
Topics: gpu-acceleration, elementwise, reduce, sgemm, sgemv, high-performance-computing, hpc
Last push: 2023-07-29T05:52:37+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 1781, "days_push": 1131, "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 1350, forks 187 (observed 2026-08-28T04:04:28.107109+00:00)

## What it is
A tutorial series repository teaching CUDA kernel optimization with detailed walkthroughs of elementwise, reduce, sgemv, and sgemm kernels. The kernels achieve near-theoretical-limit performance on V100 GPUs, benchmarked with Nsight against cuBLAS.

## Use cases
- learn how to optimize CUDA kernels
- understand vectorized memory access in CUDA
- write a high-performance sgemm kernel
- optimize reduce operations on GPU
- compare my kernel performance against cuBLAS
- learn SASS-level tuning with register remapping

## When to choose
- you want to learn GPU kernel optimization from worked examples
- you need reference implementations of near-peak elementwise, reduce, sgemv, or sgemm kernels
- you are studying HPC or preparing for GPU performance engineering work

## When to avoid
- you need a production linear algebra library - use cuBLAS or CUTLASS instead
- you want a maintained framework rather than educational code
- you target GPUs other than NVIDIA V100-class hardware without adapting the tuning

## Facets
- artifact type: learning-resource
- maturity: stable
- function: gpu-computing, benchmarking, developer-tools
- domain: gpu-computing, performance, tutorials, developer-tools
- platform: -
- tags: cuda-kernels, high-performance-computing, sgemm, sgemv, kernel-optimization, nsight, v100, gpu, cuda, linux

## Member repositories
- Liu-xiandong/How_to_optimize_in_GPU (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:28.107109+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:42:15.494960+00:00, confidence not recorded.
  - readme: https://github.com/Liu-xiandong/How_to_optimize_in_GPU (fetched 2026-08-28T04:04:28.107109+00:00, sha 071694161be4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
