Skip to content
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

Fix for Issue #412 [AMD official] #419

Merged
merged 1 commit into from
Jun 30, 2024
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
6 changes: 0 additions & 6 deletions csrc/selective_scan/selective_scan_bwd_kernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,6 @@ template<typename input_t, typename weight_t>
void selective_scan_bwd_cuda(SSMParamsBwd &params, cudaStream_t stream) {

#ifndef USE_ROCM
#define warp_size 32
#else
#define warp_size ROCM_WARP_SIZE
#endif

#if warp_size == 32
if (params.seqlen <= 128) {
selective_scan_bwd_launch<32, 4, input_t, weight_t>(params, stream);
} else if (params.seqlen <= 256) {
Expand Down
6 changes: 0 additions & 6 deletions csrc/selective_scan/selective_scan_fwd_kernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,6 @@ template<typename input_t, typename weight_t>
void selective_scan_fwd_cuda(SSMParamsBase &params, cudaStream_t stream) {

#ifndef USE_ROCM
#define warp_size 32
#else
#define warp_size ROCM_WARP_SIZE
#endif

#if warp_size == 32
if (params.seqlen <= 128) {
selective_scan_fwd_launch<32, 4, input_t, weight_t>(params, stream);
} else if (params.seqlen <= 256) {
Expand Down
18 changes: 0 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,6 @@ def append_nvcc_threads(nvcc_extra_args):

if HIP_BUILD:

try:
# set warp size based on gcn architecure
gcn_arch_name = torch.cuda.get_device_properties(0).gcnArchName
if "gfx10" in gcn_arch_name or "gfx11" in gcn_arch_name:
# radeon
warp_size = 32
else:
# instinct
warp_size = 64
except AttributeError as e:
# fall back to crude method to set warp size
device_name = torch.cuda.get_device_properties(0).name
if 'instinct' in device_name.lower():
warp_size = 64
else:
warp_size = 32

extra_compile_args = {
"cxx": ["-O3", "-std=c++17"],
"nvcc": [
Expand All @@ -226,7 +209,6 @@ def append_nvcc_threads(nvcc_extra_args):
"-U__CUDA_NO_HALF_CONVERSIONS__",
"-DCK_FMHA_FWD_FAST_EXP2=1",
"-fgpu-flush-denormals-to-zero",
f"-DROCM_WARP_SIZE={warp_size}"
]
+ cc_flag,
}
Expand Down