Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/gemm/example_gemm_intrinsics.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def make_swizzle_layout(shared_buf):
return T.Layout(shape, lambda *args: args)

def transform_func(i, j):
new_warp_i, new_warp_j = get_swizzle_layout(i, j, shape[-1], dtype)
return [new_warp_i, new_warp_j]
return list(get_swizzle_layout(i, j, shape[-1], dtype))

return T.Layout(shape, transform_func)

Expand Down
627 changes: 440 additions & 187 deletions src/cuda/op/copy.cc

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/cuda/transform/producer_consumer_ws.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include "backend/common/target_utils.h"
#include "cuda/op/copy.h"
#include "layout/cute_layout.h"
#include "multi_version_buffer_rewriter.h"
#include "op/builtin.h"
#include "op/copy.h"
Expand Down Expand Up @@ -2620,15 +2621,14 @@ class ManualWSDetector : public StmtExprVisitor {
/// swizzle modes (32B / 64B / 128B). Any other layout (e.g. padded,
/// Volta-style) cannot be used with TMA.
static bool IsTmaCompatibleLayout(const Layout &layout, const Buffer &buffer) {
// Recognised swizzle → TMA with swizzle.
if (DetectSwizzleMode(layout, buffer) != SwizzleMode::kNone) {
return true;
}
// Identity / row-major linear → TMA without swizzle.
if (StructuralEqual()(layout, makeLinearLayout(buffer->shape))) {
return true;
}
return false;
Optional<cute::ComposedLayout> composed =
cute::ComposedLayoutFromTileLang(layout);
if (!composed.defined())
return false;
// Recast to byte space (the swizzle atom is defined on byte addresses).
cute::ComposedLayout composed_bytes =
composed.value().Recast(buffer->dtype.bits(), /*new_bits=*/8);
return composed_bytes->swizzle->IsTMACompatible();
}

class TiledWSCandidate : public StmtExprVisitor {
Expand Down
Loading
Loading