NVIDIA / NVIDIA/cutlass

[QST] Result layout of logical_product is ((M,N), (TileM,TileN), L, ...)?

Open
#2,208 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

From docs: https://github.com/NVIDIA/cutlass/blob/main/media/docs/cute/02_layout_algebra.md, the result layout of logical_product is ((M,TileM), (N,TileN), L, ...). But from some example and code, i think the layout maybe is ((M,N), (TileM,TileN), L, ...). Do i miss something?

Code:
https://github.com/NVIDIA/cutlass/blob/main/include/cute/layout.hpp#L1662
make_layout(block, composition(complement(block, size(block)*cosize(tiler)), tiler)); // block layout is at first place.

example1 :
auto thr_layout = make_layout(make_shape(Int<32>{}, Int<8>{})); auto val_layout = make_layout(make_shape(Int<4>{}, Int<1>{})); auto layout_mn = logical_product(thr_layout, val_layout); --> result: ((_32,_8),(_4,_1)):((_1,_32),(_256,_0)) // block is at first.

example2 :
auto vec = Layout<Shape<_2, _5>,Stride<_5, _1>>{}; auto tile = Layout<Shape<_3, _4>,Stride<_1, _3>>{}; auto layoutR = logical_product(layoutA, layoutB); --> result: ((_2,_5),(_3,_4)):((_5,_1),(_10,_30)) // block is at first.

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 media/docs/cute/02_layout_algebra.md and include/cute/layout.hpp around line 1662. Reproduce the two logical_product examples and compare their reported shapes with the documentation and implementation. Done means explaining the ordering consistently and updating the documentation or examples if they disagree.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.