Suggestion: Add roofline/arithmetic-intensity analysis to matrixMul samples
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 9.6k
- Forks
- 2.4k
- Avg merge
- 53m
- Merged PRs (30d)
- 1
Description
The matrixMul and matrixMulCUBLAS samples report GFLOPS and execution time, and matrixMulCUBLAS already compares a custom kernel against cuBLAS — both genuinely useful for learners.
Suggestion: extend these (or add a companion sample) that additionally:
- Implements the same GEMM at multiple optimization stages — naive, shared-memory tiled, and Tensor Core (WMMA) — so learners see the actual performance delta between each technique, not just a single implementation.
- Reports arithmetic intensity (FLOPs/byte) alongside achieved GFLOPS, plotted against the GPU's roofline (peak compute vs peak memory bandwidth), so learners can see whether their kernel is memory-bound or compute-bound.
I built a small reference implementation exploring this for my own learning, benchmarked on an RTX 3050: https://github.com/ragulk143/cuda-gemm
Happy to contribute a PR along these lines if this is something the maintainers would find valuable for the samples repo.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the matrixMul and matrixMulCUBLAS samples, then compare them with the linked cuda-gemm reference implementation. Define how the naive, shared-memory tiled, and WMMA stages will be presented and how arithmetic intensity and the GPU roofline will be reported; done means learners can compare each stage's performance and bound.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100