NVIDIA / NVIDIA/cutlass

[QST] Why is the accumulation dtype in the CUTLASS FP4 GEMV example in FP16, instead of FP32?

Open
#3,330 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

? - Needs Triage CUTLASS C++ inactive-30d question
Dominant language
C++
Stars
10.5k
Forks
2.1k
Avg merge
3d 11h
Merged PRs (30d)
7

Description

What is your question?

In example 91, a GEMV with NVFP4 epilogue store is provided (https://github.com/NVIDIA/cutlass/blob/main/examples/91_fp4_gemv/91_fp4_gemv.cu). However, the usage of FP16 for accumulation mainloop seems abnormal. For example, the timing of the following shape, (M, N, K) = (1, 1024, 7168) has around a 5% performance increase on SM100 of FP16 to FP32 for the accumulator.

Is it for consumer RTX SM120, where the performance of FP32 accumulate is not good? Yet, that would be even more confusing, since this uses CUDA core based fma.rn.f16x2, and not the tensor core path (mma.sync.aligned.kind::mxf4nvf4.block_scale…f32.e2m1.e2m1.f32) (which, after further investigation, does not even support FP16 accumulation). Thus, I'm not sure if there is a specific target, or was it just an oversight of the example.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/91_fp4_gemv/91_fp4_gemv.cu and inspect the accumulator type used by the GEMV mainloop and NVFP4 epilogue. Reproduce the reported (M, N, K) = (1, 1024, 7168) timing comparison on SM100, then check the stated FP16 and FP32 instruction paths and target support. Done means the example's accumulator choice is explained or the example is corrected with matching validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.