-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[TMA] Enable unswizzled tma layouts #6238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| swizzlingByteWidth = 32; | ||
| } else { | ||
| llvm_unreachable("unsupported shared memory layout for MMAv3"); | ||
| llvm_unreachable("unsupported NVMMA layout (MMAv3 or TMA)"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| auto rank = tensorType.getRank(); | ||
| if (rank == 1 || contigDimSizeInBytes < 32 || shape[rank - 2] < 8) { | ||
| return ttg::SwizzledSharedEncodingAttr::get(ctx, 1, 1, 1, order, ctaLayout); | ||
| } |
There was a problem hiding this comment.
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]]>>, {{.*}} |
There was a problem hiding this comment.
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.
ThomasRaoux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.