Skip to content

Conversation

@peterbell10
Copy link
Contributor

No description provided.

@peterbell10 peterbell10 requested a review from ptillet as a code owner March 18, 2025 21:40
swizzlingByteWidth = 32;
} else {
llvm_unreachable("unsupported shared memory layout for MMAv3");
llvm_unreachable("unsupported NVMMA layout (MMAv3 or TMA)");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related, but seeing this MMAv3 message was a bit confusing on blackwell.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it was dropped before the shared memory encoding refactoring

@peterbell10 peterbell10 requested a review from ThomasRaoux March 18, 2025 22:38
auto rank = tensorType.getRank();
if (rank == 1 || contigDimSizeInBytes < 32 || shape[rank - 2] < 8) {
return ttg::SwizzledSharedEncodingAttr::get(ctx, 1, 1, 1, order, ctaLayout);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, now defaulting to unswizzled encodings if there are fewer than 8 rows of data.

// CHECK-DAG: #[[NVMMA_32:.*]] = #ttg.nvmma_shared<{swizzlingByteWidth = 32, transposed = false, elementBitWidth = 8}>
tt.func public @tma_scatter(%arg0: !tt.ptr<i8> {tt.divisibility = 16 : i32}, %arg1: i32 {tt.divisibility = 16 : i32}, %arg2: i32 {tt.divisibility = 16 : i32}, %arg3: tensor<32xi32, #blocked>, %arg4: tensor<32x32xi8, #blocked1>) {
// CHECK: tt.make_tensor_descriptor {{.*}} : <i8>, <tensor<1x32xi8, #[[NVMMA_32]]>>
// CHECK: tt.descriptor_scatter {{.*}} : !tt.tensordesc<tensor<1x32xi8, #[[NVMMA_32]]>>, {{.*}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test ensures that gather/scatter still use swizzling despite the descriptor's block shape only having 1 row.

Copy link
Collaborator

@ThomasRaoux ThomasRaoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@peterbell10 peterbell10 merged commit 3887b80 into main Mar 22, 2025
8 checks passed
@peterbell10 peterbell10 deleted the pb/unswizzled-tma branch March 22, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants