Skip to content

[CUTLASS][WIP] Gate rowwise matmul CUTLASS kernels by compute capability #152642

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions aten/src/ATen/native/cuda/RowwiseScaledMM.cu
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ void f8f8bf16_rowwise_impl(
std::optional<at::Tensor> bias,
at::Tensor out,
const int swizzle) {
#if (defined(__CUDA_ARCH__)) && (__CUDA_ARCH__ == 900)
int M = XQ.size(0);
int N = WQ.size(1);
int K = XQ.size(1);
Expand Down Expand Up @@ -298,6 +299,7 @@ void f8f8bf16_rowwise_impl(
cutlass::cutlassGetStatusString(status));
}
C10_CUDA_KERNEL_LAUNCH_CHECK();
#endif
}


Expand All @@ -318,6 +320,7 @@ void f8f8bf16_rowwise_impl_sm100(
std::optional<at::Tensor> bias,
at::Tensor out,
const int swizzle) {
#if (defined(__CUDA_ARCH__)) && (__CUDA_ARCH__ == 1000 || __CUDA_ARCH__ == 1030)
int M = XQ.size(0);
int N = WQ.size(1);
int K = XQ.size(1);
Expand Down Expand Up @@ -480,6 +483,7 @@ void f8f8bf16_rowwise_impl_sm100(
cutlass::cutlassGetStatusString(status));
}
C10_CUDA_KERNEL_LAUNCH_CHECK();
#endif
}

// Cutlass rowwise kernel for SM89
Expand All @@ -498,6 +502,7 @@ void f8f8bf16_rowwise_impl_sm89(
at::Tensor w_scale,
std::optional<at::Tensor> bias,
at::Tensor out) {
#if (defined(__CUDA_ARCH__)) && (__CUDA_ARCH__ == 890)
Copy link
Collaborator

Choose a reason for hiding this comment

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

The test failures are really strange. As if this condition was evaluated as false.

int M = XQ.size(0);
int N = WQ.size(1);
int K = XQ.size(1);
Expand Down Expand Up @@ -695,6 +700,7 @@ void f8f8bf16_rowwise_impl_sm89(
cutlass::cutlassGetStatusString(status));
}
C10_CUDA_KERNEL_LAUNCH_CHECK();
#endif
}

template <typename ClusterShape, typename... Types>
Expand Down
Loading