← Latest papers
💻 computer science

High-Performance FP16 General Matrix Multiplication on NVIDIA Ada Lovelace via CUTLASS and WMMA: A Benchmark and Pipeline-Depth Analysis

This paper benchmarks FP16 GEMM performance on NVIDIA's Ada Lovelace RTX 4060 across cuBLAS, CUTLASS, and custom WMMA implementations, revealing that a pipeline depth of three with specific tile geometry achieves 52.7% of peak throughput while demonstrating that shared-memory pressure, rather than pipeline depth, is the primary bottleneck limiting further optimization.

Original authors: Lucas Lima Freitag

Published 2026-07-15
📖 5 min read🧠 Deep dive

Original authors: Lucas Lima Freitag

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a super-fast kitchen (a GPU) with a team of specialized chefs called Tensor Cores. These chefs are incredibly fast at chopping and mixing ingredients (matrix multiplication) for a giant feast (deep learning). The kitchen on the new "Ada Lovelace" stove (an RTX 4060 graphics card) is theoretically capable of serving 60.55 TFLOPS (that's 60.55 trillion math operations per second).

But here's the catch: just because the chefs can chop that fast doesn't mean they are chopping that fast. They often have to wait for ingredients to be delivered from the pantry.

The Big Experiment: How to Keep Chefs Busy

The researchers wanted to figure out the best way to organize the kitchen so the chefs never stop chopping. They tested three different ways to run the kitchen:

  1. The Black Box (cuBLAS): A pre-packaged, closed-source recipe from NVIDIA that usually works great but doesn't let you tweak the details.
  2. The Open Blueprint (CUTLASS): A flexible, open-source toolkit that lets you build your own kitchen layout from scratch.
  3. The DIY Approach (WMMA): A custom-built kitchen where you control every single movement of the chefs, but it's much harder to build.

They set up a massive cooking challenge with ingredients sized 8192 × 8192 and tried different "pipeline depths." Think of pipeline depth as the number of ingredient trays the kitchen keeps ready.

  • Pipeline Depth 2: Only 2 trays ready.
  • Pipeline Depth 3: 3 trays ready.
  • Pipeline Depth 4: 4 trays ready.

The common wisdom (and a simple math model) suggested that more trays = more speed. The logic was: "If we have more trays, the chefs will never run out of ingredients, so they'll work faster."

The Surprise: More Isn't Always Better

The researchers measured the speed, and here is what they found:

  • Depth 2: The kitchen ran at 25.6 TFLOPS. The chefs were waiting around too much.
  • Depth 3: The kitchen sped up to 31.9 TFLOPS (which is 52.7% of the theoretical maximum). This was the sweet spot!
  • Depth 4: The kitchen actually slowed down to 31.1 TFLOPS.

This is the main finding: Adding that fourth tray didn't help; it made things worse. The simple math model predicted the speed should have jumped to 35.4 TFLOPS, but it didn't. The model was wrong by 13.8%.

Why Did Adding a Tray Backfire?

The paper explains that the kitchen has limited space. When they added the 4th tray (increasing the "Shared Memory" usage to 96 KB), it forced the kitchen to reduce the number of cooking teams (threadblocks) that could work at the same time.

  • With 3 trays, the kitchen could fit 2 teams of chefs on each stove.
  • With 4 trays, the kitchen could only fit 1 team.

Even though the single team had more ingredients, they had to wait longer because there were fewer teams to swap in when one got stuck. The kitchen became "crowded" with ingredients but "empty" of workers. The researchers measured that the occupancy (how many teams are working) dropped, and the chefs had to use more "registers" (their personal notepads), which also slowed them down.

The Winners and Losers

  • The Winner: The CUTLASS toolkit with 3 trays and a specific tile size of 256 × 128. It hit 31.9 TFLOPS. This was so good it actually beat the standard "Black Box" (cuBLAS) by a tiny, almost unmeasurable 1.3% (which the authors say is likely just noise, but it proves the open blueprint can match the closed one).
  • The DIY Runner-Up: The custom WMMA kernel (the fully DIY kitchen) managed 25.1 TFLOPS on a slightly smaller test. It was slower because it didn't use the fancy "double buffering" tricks to overlap ingredient delivery with cooking.
  • The Loser: The idea that "more pipeline depth is always better." The paper explicitly rules this out for this specific hardware.

How Sure Are They?

The authors are very confident in these numbers because they measured them directly on the hardware, running the test 10 times and averaging the results. They even checked their math against a built-in NVIDIA tool (the profiler) and found their custom code matched it perfectly.

However, they admit a few things they didn't prove:

  • They only tested one specific size of problem (8192). They don't know if the "3 trays is best" rule holds for smaller or weirdly shaped problems.
  • They couldn't test pipeline depths higher than 4 because the kitchen simply ran out of space (memory).
  • They had to run their tests on Windows, where a driver glitch prevented them from comparing their custom code and the standard code in the exact same run (though they did it in separate runs).

The Takeaway

If you are trying to get the most out of a consumer graphics card like the RTX 4060 for math-heavy tasks, don't just keep adding more buffers. There is a "Goldilocks" zone. In this case, 3 stages of preparation was perfect. Going to 4 stages made the kitchen too cramped, slowing everyone down.

The researchers have released all their code as open-source, so anyone can try to build their own kitchen and see if they can beat the 31.9 TFLOPS record. They suggest that future work should look at different problem sizes and use Linux to get even cleaner data, but for now, they have shown that 31.9 TFLOPS is the current peak for this setup, and that 31.1 TFLOPS is what happens when you try to be too greedy with memory.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →