rank_2k_universal and symm_universal Arguments constructors discard batch_stride_B
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start with the Arguments constructors at include/cutlass/gemm/kernel/rank_2k_universal.h:176 and include/cutlass/gemm/kernel/symm_universal.h:173, comparing them with trmm_universal.h:158. Reproduce the issue with the host program described in the report and verify that passing 200 preserves batch_stride_B, including through transposed_problem().
Written by the indexing model from the issue text.
Description
Description
The Arguments constructors of two kernels discard their batch_stride_B parameter and store 0 instead:
// include/cutlass/gemm/kernel/rank_2k_universal.h:176
batch_stride_A(batch_stride_A), batch_stride_B(0),
// include/cutlass/gemm/kernel/symm_universal.h:173
batch_stride_A(batch_stride_A), batch_stride_B(0),
trmm_universal.h:158 stores its parameter (batch_stride_B(batch_stride_B)), which makes the intent clear; these are copy-paste typos. Confirmed by constructing Arguments for both kernels in a host program and printing the stored field: passing 200 stores 0.
Consequences:
Paramsconstruction copiesargs.batch_stride_B, so downstream code always sees stride 0.- Both kernels'
transposed_problem()doesstd::swap(args.batch_stride_A, args.batch_stride_B)on anArgumentsbuilt by that constructor (rank_2k_universal.h:189), so after the swap the storedbatch_stride_Abecomes the dead 0 too: for the transposed path both batch strides are wrong, not just B's.
Additional observation while tracing this: neither kernel body ever reads params.batch_stride_A or params.batch_stride_B (unlike gemm_universal.h, which advances both pointers per batch), so batched operation through these kernels keeps A and B fixed across batches regardless of the arguments. The typo is provable on its own; the unused-stride observation may deserve separate attention.
Suggested fix
Store the parameter in both places:
batch_stride_A(batch_stride_A), batch_stride_B(batch_stride_B),
- Dominant language
- C++
- Stars
- 10.5k
- Forks
- 2.1k
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 7
Contributor guide
No contributing guide indexed for this repository
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.
More from NVIDIA/cutlass
-
CUTLASS C++
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
CUTLASS C++
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
CUTLASS C++
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
CUTLASS C++
Difficulty 1/5 Under an hour Newbie friendliness 91/100
-
CUTLASS C++
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
infiniflow/infinity#3502 ·