Giter Club home page Giter Club logo

gemm_mma's Introduction

GEMM MMA 首先构建了一个初级的GEMM kernel, 它使用CUDA mma.sync指令来使用GPU tensor core单元,之后每次引入一个优化概念并对比性能变化

最终优化的性能: 73.65% (相比cutlass算子,测试维度为8192x8192x8192)

source code: gemm.cu

一步步优化GEMM系列,每次引入一个优化概念并对比性能变化,代码在每个分支的gemm.cu

baseline性能: 3.44%

vector分支主要介绍向量化load/store,

优化后性能: 4.74%

bfco分支主要介绍如何通过解决shared memory bank conflict 和 memory coalesce (访存合并) 来优化性能

优化后性能: 5.00%

ldgsts 分支主要来介绍使用Ampere引入的异步拷贝来优化性能

优化后性能: 5.36%

reg 分支介绍使用寄存器来优化性能

优化后性能: 35.39%

prefetch 分支介绍使用数据预取来优化性能

优化后性能:39.36%

ptxas 分支分享一个调优过程中发现的关于ptxas(ptx汇编器)有意思的东西

prefetchx 分支和之前的prefetch分支类似,区别是增加了预取数据大小并利用了同步指令cp.async.waitgroup N

优化后性能:46.89%

shape 分支调整了每个block和warp计算的矩阵C的大小

优化后性能:62.39%

swizzle 分支调整每个thread block分配到的计算位置来优化性能

优化后性能: 68.43%

ldmatrix 分支使用ldmatrix指令来加载共享内存

优化后性能: 73.65%

epilogue 分支增加了对参数alphabeta的支持

gemm_mma's People

Contributors

gty111 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.