NVIDIA / NVIDIA/cutlass

[QST] TMA / CuTe 1D "im2col"

Open
#1,694 3 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?

Is there a way to use TMA / CuTe to perform that following load pattern:

Starting with this 1-D tensor,

[1, 2, 3, 4]

I'd like to load the following 2-D tensor in smem without materializing in gmem:

[
 [4, 0, 0, 0]
 [3, 4, 0, 0]
 [2, 3, 4, 0]
 [1, 2, 3, 4]
]

The 2-D tensor will always be square, with dim0==dim1 >= dim of original 1-D tensor.

More generally, there will be N 1-D tensors in gmem:

[
 [1, 2, 3, 4]
 [5, 6, 7, 8]
 ...
 ]

Each of which will be expanded to 2-D tensors (each threadblock indexing one such 2-D tensor)
in smem:

[
[4, 0, 0, 0]
[3, 4, 0, 0]
[2, 3, 4, 0]
[1, 2, 3, 4]
]

[
[8, 0, 0, 0]
[7, 8, 0, 0]
[6, 7, 8, 0]
[5, 6, 7, 8]
]

This is similar to im2col for 4D image tensors, but in this case we're starting with 1-D tensors.

@thakkarV @Ethan-Yan27 @ccecka

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

No file, test, or entry point is named. Start by identifying the existing TMA/CuTe transfer entry points relevant to the requested expansion; done means a maintainer-confirmed answer about whether this pattern is expressible, with any required implementation scope made explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.