NVIDIA / NVIDIA/cutlass

[QST] Why does slice_and_offset() (in swizzle_layout.hpp) not consider smem_ptr_flag_bits ?

Open
#3,023 2 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

What is your question?
Based on my understanding of the implementation of slice_and_offset() for swizzle layout, it tries to make the input swizzle layout decay to a normal layout. The implementation seems to assume that the input swizzle layout is position independent? But what if the Offset is smem_ptr_flag_bits? smem_ptr_flag_bits will make the swizzle layout position dependent. Would it decay to a normal layout mistakenly?

I noticed there exist slice operations for smem ptr flagged swizzle layouts in CUTLASS, which will call slice_and_offset().

E.g.
typename Params::TMA_A tma_load_a = make_tma_copy_A_sm90(
GmemTiledCopyA{},
tensor_a,
SmemLayoutA{}(,,cute::Int<0>{}),
TileShape{},
ClusterShape{});

SmemLayoutA is indeed an smem ptr flagged swizzle layout. Does it just happen not to decay to a normal layout?

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 in swizzle_layout.hpp at slice_and_offset(), then trace how smem_ptr_flag_bits is represented in the flagged swizzle layouts used by the TMA_A example. Compare the slice operations for smem pointer flagged layouts and determine whether the decay preserves position dependence; done means a confirmed explanation with a focused correction if the behavior is wrong.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
hpc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.