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
4 changes: 4 additions & 0 deletions tests/cpp/operator/test_multi_swizzle.cu
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ std::vector<std::tuple<int, size_t, size_t, bool>> multi_tensor_test_cases = {
{3, 256, 4096, false},
{2, 128, 8192, true},
{2, 128, 8192, false},
// Rowwise num_tiles_k = 34 selects vec_load_size = 2 (int2 kernel)
{2, 128, 4352, true},
// Colwise num_tiles_k = 512 / 32 / 4 = 4 selects vec_load_size = 4 (int4 kernel)
{2, 512, 4096, false},
};

} // namespace
Expand Down
12 changes: 8 additions & 4 deletions transformer_engine/common/swizzle/swizzle.cu
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@ __global__ void __launch_bounds__(TB_DIM* TB_DIM)
}

template <typename LType, int SF_TILE_DIM_M, int SF_TILE_DIM_K>
__global__ void multi_tensor_unswizzle_row_scaling_kernel(MultiSwizzleArgs kernel_args) {
__global__ void __launch_bounds__(TB_DIM* TB_DIM)
multi_tensor_unswizzle_row_scaling_kernel(MultiSwizzleArgs kernel_args) {
const int bid = blockIdx.x;
int tensor_id = 0;
while (kernel_args.block_range[tensor_id + 1] <= bid) {
Expand All @@ -818,7 +819,8 @@ __global__ void multi_tensor_unswizzle_row_scaling_kernel(MultiSwizzleArgs kerne
}

template <typename LType, int SF_TILE_DIM_M, int SF_TILE_DIM_K>
__global__ void multi_tensor_unswizzle_col_scaling_kernel(MultiSwizzleArgs kernel_args) {
__global__ void __launch_bounds__(TB_DIM* TB_DIM)
multi_tensor_unswizzle_col_scaling_kernel(MultiSwizzleArgs kernel_args) {
const int bid = blockIdx.x;
int tensor_id = 0;
while (kernel_args.block_range[tensor_id + 1] <= bid) {
Expand All @@ -844,7 +846,8 @@ __global__ void multi_tensor_unswizzle_col_scaling_kernel(MultiSwizzleArgs kerne
}

template <typename LType, int SF_TILE_DIM_M, int SF_TILE_DIM_K>
__global__ void multi_tensor_swizzle_row_scaling_kernel(MultiSwizzleArgs kernel_args) {
__global__ void __launch_bounds__(TB_DIM* TB_DIM)
multi_tensor_swizzle_row_scaling_kernel(MultiSwizzleArgs kernel_args) {
// Find tensor corresponding to block
const int bid = blockIdx.x;
int tensor_id = 0;
Expand Down Expand Up @@ -878,7 +881,8 @@ __global__ void multi_tensor_swizzle_row_scaling_kernel(MultiSwizzleArgs kernel_
}

template <typename LType, int SF_TILE_DIM_M, int SF_TILE_DIM_K>
__global__ void multi_tensor_swizzle_col_scaling_kernel(MultiSwizzleArgs kernel_args) {
__global__ void __launch_bounds__(TB_DIM* TB_DIM)
multi_tensor_swizzle_col_scaling_kernel(MultiSwizzleArgs kernel_args) {
// Find tensor corresponding to block
const int bid = blockIdx.x;
int tensor_id = 0;
Expand Down
Loading