Repository navigation
[ROCm] Pair gfx1250 support with gfx1250-strict #3639
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,7 @@ bool _scaled_mm_allowed_device(bool sm90_only=false, bool sm100_only=false) { | |
| "gfx950", | ||
| #endif | ||
| #if ROCM_VERSION >= 71400 | ||
| "gfx1250", | ||
| "gfx1250", "gfx1250-strict", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gfx1250-strict is not available in 7.14, will need a separate ROCm version check |
||
| #endif | ||
| }; | ||
| return at::detail::getCUDAHooks().isGPUArch(archs); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -257,7 +257,7 @@ __device__ inline void cmtdStore(void* address, T value) { | |
| if constexpr (wait_for_commit) | ||
| { | ||
| __atomic_signal_fence(__ATOMIC_SEQ_CST); | ||
| #ifdef __gfx1250__ | ||
| #if defined(__gfx1250__) || defined(__gfx1250_strict__) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets confirm if the compiler is defining the macro - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, a recent version of LLVM will define that when compiling for gfx1250-strict |
||
| asm volatile("s_wait_loadcnt(0)" ::: "memory"); | ||
| #else | ||
| asm volatile("s_waitcnt vmcnt(0)" ::: "memory"); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ def evaluate_gfx_arch_within(arch_list): | |
| _CDNA2_ARCHS = ["gfx90a"] | ||
| _CDNA3_ARCHS = ["gfx942", "gfx950"] | ||
| # GFX1250 (CDNA 5) | ||
| _CDNA5_ARCHS = ["gfx1250"] | ||
| _CDNA5_ARCHS = ["gfx1250", "gfx1250-strict"] | ||
|
|
||
| def CDNA5OrLater(): | ||
| return evaluate_gfx_arch_within(_CDNA5_ARCHS) | ||
|
|
@@ -83,13 +83,13 @@ def CDNA2OrLater(): | |
|
|
||
| # Archs that take the opportunistic_fastAtomicAdd path (packed 2x16 atomics + DPP | ||
| # lane coalescing) in ScatterGatherKernel.cu. Keep in sync with that kernel's arch | ||
| # gate; this is intentionally not CDNA3OrLater (gfx1250 uses plain fastAtomicAdd). | ||
| # gate; this is intentionally not CDNA3OrLater (gfx1250/gfx1250-strict use plain fastAtomicAdd). | ||
| def gfx_arch_supports_opportunistic_fastatomics(): | ||
| return evaluate_gfx_arch_within(["gfx942", "gfx950"]) | ||
|
|
||
| def evaluate_platform_supports_flash_attention(): | ||
| if TEST_WITH_ROCM: | ||
| arch_list = ["gfx90a", "gfx942", "gfx1100", "gfx1201", "gfx950", "gfx1250"] | ||
| arch_list = ["gfx90a", "gfx942", "gfx1100", "gfx1201", "gfx950", "gfx1250", "gfx1250-strict"] | ||
| if os.environ.get("TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL", "0") != "0": | ||
| arch_list += ["gfx1101", "gfx1102", "gfx1150", "gfx1151", "gfx1200"] | ||
| return evaluate_gfx_arch_within(arch_list) | ||
|
|
@@ -107,7 +107,7 @@ def evaluate_platform_supports_ck_sdpa(): | |
|
|
||
| def evaluate_platform_supports_efficient_attention(): | ||
| if TEST_WITH_ROCM: | ||
| arch_list = ["gfx90a", "gfx942", "gfx1100", "gfx1201", "gfx950", "gfx1250"] | ||
| arch_list = ["gfx90a", "gfx942", "gfx1100", "gfx1201", "gfx950", "gfx1250", "gfx1250-strict"] | ||
| if os.environ.get("TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL", "0") != "0": | ||
| arch_list += ["gfx1101", "gfx1102", "gfx1150", "gfx1151", "gfx1200"] | ||
| return evaluate_gfx_arch_within(arch_list) | ||
|
|
@@ -194,7 +194,7 @@ def evaluate_platform_supports_fp8(): | |
| if ROCM_VERSION >= (6, 5): | ||
| archs.append('gfx95') | ||
| if ROCM_VERSION >= (7, 14): | ||
| archs.append('gfx1250') | ||
| archs.extend(['gfx1250', 'gfx1250-strict']) | ||
| for arch in archs: | ||
| if arch in torch.cuda.get_device_properties(0).gcnArchName: | ||
| return True | ||
|
|
@@ -211,8 +211,8 @@ def evaluate_platform_supports_fp8_grouped_gemm(): | |
| if torch.version.hip: | ||
| if "USE_MSLK" not in torch.__config__.show(): | ||
| return False | ||
| # gfx1250 omitted: MSLK only builds gfx942/gfx950 kernels (see the arch | ||
| # filter in aten/src/ATen/CMakeLists.txt). Add gfx1250 here once MSLK does. | ||
| # gfx1250/gfx1250-strict omitted: MSLK only builds gfx942/gfx950 kernels | ||
| # (see the arch filter in aten/src/ATen/CMakeLists.txt). Add them here once MSLK does. | ||
| archs = ['gfx942', 'gfx950'] | ||
| for arch in archs: | ||
| if arch in torch.cuda.get_device_properties(0).gcnArchName: | ||
|
|
@@ -226,7 +226,9 @@ def evaluate_platform_supports_mx_gemm(): | |
| if torch.version.hip: | ||
| if ROCM_VERSION >= (7, 0): | ||
| gcn_name = torch.cuda.get_device_properties(0).gcnArchName | ||
| return 'gfx950' in gcn_name or ('gfx1250' in gcn_name and ROCM_VERSION >= (7, 14)) | ||
| return 'gfx950' in gcn_name or ( | ||
| ('gfx1250' in gcn_name or 'gfx1250-strict' in gcn_name) and ROCM_VERSION >= (7, 14) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick, 'gfx1250' in gcn_name also works when gcn_name is 'gfx1250-strict' |
||
| ) | ||
| else: | ||
| return SM100OrLater | ||
| return False | ||
|
|
||
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.
gfx1250-strict is not available in 7.14, will need a separate ROCm version check