[DOC] Wrong stride in Layout Algebra docs, composition worked example

Open Beginner friendly
#3,182 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp, python
Domain
documentation

Research direction

Open media/docs/cpp/cute/02_layout_algebra.md and read the Computing Composition section around the (3,6,2,8) / 72 example. Confirm the stride tuple against the rule and the provided Python verification, then correct the third entry from 4x to 4y and check that the rendered documentation reflects the change.

Written by the indexing model from the issue text.

Description

? - Needs Triage documentation inactive-30d inactive-90d

Report incorrect documentation

Location of incorrect documentation
media/docs/cpp/cute/02_layout_algebra.md.
https://docs.nvidia.com/cutlass/latest/media/docs/cpp/cute/02_layout_algebra.html

Describe the problems or issues found in the documentation
In the example in the Computing Composition section, The third entry in the resulting stride tuple is written as 4*x, but it should be 4*y. Each entry in the result is supposed to be the residue multiplied by the corresponding mode's original stride which is y for the third residue, since the strides of A are (w, x, y, z). This is likely just a typo.

Steps taken to verify documentation is incorrect
Re-derived the residues for (3,6,2,8) / 72 mode-by-mode using the rule described earlier in the same section. This result can be verified with:

import cutlass.cute as cute

@cute.jit
def check():
    # Pick (w,x,y,z) = (1,3,18,36) so that x and y are DIFFERENT numbers.
    A = cute.make_layout((3, 6, 2, 8), stride=(1, 3, 18, 36))
    R = cute.composition(A, cute.make_layout(4, stride=72))
    cute.printf("R       = {}", R)  # prints: 4:72
    cute.printf("strides = {}", R.stride)  # prints:  72
check()

# Then the third stride lets us tell the two predictions apart:
print("old     = (72, 72, 12, 72)  # 4*x = 4*3  = 12")
print("fixed   = (72, 72, 72, 72)  # 4*y = 4*18 = 72")

Suggested fix for documentation.
Change:

... produces (72*w,24*x,4*x,2*z) as the strides of the strided layout.

to:

... produces (72*w,24*x,4*y,2*z) as the strides of the strided layout

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

  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.

More from NVIDIA/cutlass

All issues in NVIDIA/cutlass

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.