|
| 1 | +From 08071937d4c2c34f619ed5b49bd0ced4805875fa Mon Sep 17 00:00:00 2001 |
| 2 | +From: Mika Laitio <lamikr@gmail.com> |
| 3 | +Date: Sat, 13 Jul 2024 21:07:11 -0400 |
| 4 | +Subject: [PATCH 5/5] gfx1036 and gfx1103 support |
| 5 | + |
| 6 | +Signed-off-by: Mika Laitio <lamikr@gmail.com> |
| 7 | +--- |
| 8 | + .../composable_kernel/include/utility/config.hpp | 15 ++++++++------- |
| 9 | + src/include/miopen/solver/ck_utility_common.hpp | 8 +++++++- |
| 10 | + src/target_properties.cpp | 14 ++++++++++++-- |
| 11 | + 3 files changed, 27 insertions(+), 10 deletions(-) |
| 12 | + |
| 13 | +diff --git a/src/composable_kernel/composable_kernel/include/utility/config.hpp b/src/composable_kernel/composable_kernel/include/utility/config.hpp |
| 14 | +index 5957a79d8..6ca920b5e 100644 |
| 15 | +--- a/src/composable_kernel/composable_kernel/include/utility/config.hpp |
| 16 | ++++ b/src/composable_kernel/composable_kernel/include/utility/config.hpp |
| 17 | +@@ -16,8 +16,8 @@ |
| 18 | + #if !(defined(CK_AMD_GPU_GFX803) || defined(CK_AMD_GPU_GFX900) || defined(CK_AMD_GPU_GFX906) || \ |
| 19 | + defined(CK_AMD_GPU_GFX940) || defined(CK_AMD_GPU_GFX908) || defined(CK_AMD_GPU_GFX90A) || \ |
| 20 | + defined(CK_AMD_GPU_GFX941) || defined(CK_AMD_GPU_GFX942) || defined(CK_AMD_GPU_GFX1010) || defined(CK_AMD_GPU_GFX1030) || \ |
| 21 | +- defined(CK_AMD_GPU_GFX1031) || defined(CK_AMD_GPU_GFX1035) || defined(CK_AMD_GPU_GFX1100) || defined(CK_AMD_GPU_GFX1101) || \ |
| 22 | +- defined(CK_AMD_GPU_GFX1102)) |
| 23 | ++ defined(CK_AMD_GPU_GFX1031) || defined(CK_AMD_GPU_GFX1035) || defined(CK_AMD_GPU_GFX1036) || defined(CK_AMD_GPU_GFX1100) || defined(CK_AMD_GPU_GFX1101) || \ |
| 24 | ++ defined(CK_AMD_GPU_GFX1102) || defined(CK_AMD_GPU_GFX1103)) |
| 25 | + #error Need to define (only) one GPU target |
| 26 | + #endif |
| 27 | + |
| 28 | +@@ -29,14 +29,15 @@ |
| 29 | + #define CK_MIN_BLOCK_PER_CU 2 |
| 30 | + #endif |
| 31 | + |
| 32 | +-// TODO: gfx1010 check CK_BUFFER_RESOURCE_3RD_DWORD |
| 33 | ++// TODO: composable_kernel has differend CK_BUFFER_RESOURCE_3RD_DWORD for gfx110* devices |
| 34 | + // buffer resourse |
| 35 | + #if defined(CK_AMD_GPU_GFX803) || defined(CK_AMD_GPU_GFX900) || defined(CK_AMD_GPU_GFX906) || \ |
| 36 | + defined(CK_AMD_GPU_GFX941) || defined(CK_AMD_GPU_GFX942) || defined(CK_AMD_GPU_GFX940) || \ |
| 37 | +- defined(CK_AMD_GPU_GFX908) || defined(CK_AMD_GPU_GFX90A) || defined(CK_AMD_GPU_GFX1010) |
| 38 | ++ defined(CK_AMD_GPU_GFX908) || defined(CK_AMD_GPU_GFX90A) |
| 39 | + #define CK_BUFFER_RESOURCE_3RD_DWORD 0x00020000 |
| 40 | +-#elif defined(CK_AMD_GPU_GFX1030) || defined(CK_AMD_GPU_GFX1031) || defined(CK_AMD_GPU_GFX1035) || defined(CK_AMD_GPU_GFX1100) || \ |
| 41 | +- defined(CK_AMD_GPU_GFX1101) || defined(CK_AMD_GPU_GFX1102) |
| 42 | ++#elif defined(CK_AMD_GPU_GFX1010) || defined(CK_AMD_GPU_GFX1030) || defined(CK_AMD_GPU_GFX1031) || \ |
| 43 | ++ defined(CK_AMD_GPU_GFX1035) || defined(CK_AMD_GPU_GFX1036) || \ |
| 44 | ++ defined(CK_AMD_GPU_GFX1100) || defined(CK_AMD_GPU_GFX1101) || defined(CK_AMD_GPU_GFX1102) || defined(CK_AMD_GPU_GFX1103) |
| 45 | + #define CK_BUFFER_RESOURCE_3RD_DWORD 0x31014000 |
| 46 | + #endif |
| 47 | + |
| 48 | +@@ -49,7 +50,7 @@ |
| 49 | + #elif defined(CK_AMD_GPU_GFX906) || defined(CK_AMD_GPU_GFX908) || defined(CK_AMD_GPU_GFX90a) || \ |
| 50 | + defined(CK_AMD_GPU_GFX941) || defined(CK_AMD_GPU_GFX942) || defined(CK_AMD_GPU_GFX940) || \ |
| 51 | + defined(CK_AMD_GPU_GFX1030) || defined(CK_AMD_GPU_GFX1031) || defined(CK_AMD_GPU_GFX1100) || \ |
| 52 | +- defined(CK_AMD_GPU_GFX1101) || defined(CK_AMD_GPU_GFX1102) |
| 53 | ++ defined(CK_AMD_GPU_GFX1101) || defined(CK_AMD_GPU_GFX1102) || defined(CK_AMD_GPU_GFX1103) |
| 54 | + #define CK_USE_AMD_V_FMAC_F32 |
| 55 | + #define CK_USE_AMD_V_DOT2_F32_F16 |
| 56 | + #define CK_USE_AMD_V_DOT4_I32_I8 |
| 57 | +diff --git a/src/include/miopen/solver/ck_utility_common.hpp b/src/include/miopen/solver/ck_utility_common.hpp |
| 58 | +index aea036066..ea5629871 100644 |
| 59 | +--- a/src/include/miopen/solver/ck_utility_common.hpp |
| 60 | ++++ b/src/include/miopen/solver/ck_utility_common.hpp |
| 61 | +@@ -61,9 +61,11 @@ static inline bool is_ck_supported_hardware(const Handle& handle) |
| 62 | + StartsWith(handle.GetDeviceName(), "gfx1030") || |
| 63 | + StartsWith(handle.GetDeviceName(), "gfx1031") || |
| 64 | + StartsWith(handle.GetDeviceName(), "gfx1035") || |
| 65 | ++ StartsWith(handle.GetDeviceName(), "gfx1036") || |
| 66 | + StartsWith(handle.GetDeviceName(), "gfx1100") || |
| 67 | + StartsWith(handle.GetDeviceName(), "gfx1101") || |
| 68 | +- StartsWith(handle.GetDeviceName(), "gfx1102"); |
| 69 | ++ StartsWith(handle.GetDeviceName(), "gfx1102") || |
| 70 | ++ StartsWith(handle.GetDeviceName(), "gfx1103"); |
| 71 | + } |
| 72 | + |
| 73 | + // MI100 : gfx908 |
| 74 | +@@ -121,12 +123,16 @@ static inline auto get_ck_common_compiler_flag(const Handle& handle) |
| 75 | + compiler_flag << " -DCK_AMD_GPU_GFX1031"; |
| 76 | + else if(StartsWith(device_name, "gfx1035")) |
| 77 | + compiler_flag << " -DCK_AMD_GPU_GFX1035"; |
| 78 | ++ else if(StartsWith(device_name, "gfx1036")) |
| 79 | ++ compiler_flag << " -DCK_AMD_GPU_GFX1036"; |
| 80 | + else if(StartsWith(device_name, "gfx1100")) |
| 81 | + compiler_flag << " -DCK_AMD_GPU_GFX1100"; |
| 82 | + else if(StartsWith(device_name, "gfx1101")) |
| 83 | + compiler_flag << " -DCK_AMD_GPU_GFX1101"; |
| 84 | + else if(StartsWith(device_name, "gfx1102")) |
| 85 | + compiler_flag << " -DCK_AMD_GPU_GFX1102"; |
| 86 | ++ else if(StartsWith(device_name, "gfx1103")) |
| 87 | ++ compiler_flag << " -DCK_AMD_GPU_GFX1103"; |
| 88 | + // NOLINTEND(*-braces-around-statements) |
| 89 | + |
| 90 | + // buffer atomic-fadd |
| 91 | +diff --git a/src/target_properties.cpp b/src/target_properties.cpp |
| 92 | +index c3fa2bd3a..de979aae9 100644 |
| 93 | +--- a/src/target_properties.cpp |
| 94 | ++++ b/src/target_properties.cpp |
| 95 | +@@ -52,9 +52,19 @@ static std::string GetDeviceNameFromMap(const std::string& in) |
| 96 | + {"gfx804", "gfx803"}, |
| 97 | + {"Vega10", "gfx900"}, |
| 98 | + {"gfx901", "gfx900"}, |
| 99 | +- {"Navi10", "gfx1010"}, |
| 100 | ++ {"navi10", "gfx1010"}, |
| 101 | ++ {"navi12", "gfx1011"}, |
| 102 | ++ {"navi14", "gfx1012"}, |
| 103 | + {"10.3.0 Sienna_Cichlid 18", "gfx1030"}, |
| 104 | +- {"Rembrandt", "gfx1035"}, |
| 105 | ++ {"navi22", "gfx1031"}, |
| 106 | ++ {"navi23", "gfx1032"}, |
| 107 | ++ {"navi24", "gfx1034"}, |
| 108 | ++ {"rembrandt", "gfx1035"}, |
| 109 | ++ {"raphael", "gfx1036"}, |
| 110 | ++ {"navi31", "gfx1100"}, |
| 111 | ++ {"navi32", "gfx1101"}, |
| 112 | ++ {"navi33", "gfx1102"}, |
| 113 | ++ {"phoenix", "gfx1103"}, |
| 114 | + }; |
| 115 | + |
| 116 | + const auto& dev_str = miopen::GetStringEnv(ENV(MIOPEN_DEBUG_ENFORCE_DEVICE)); |
| 117 | +-- |
| 118 | +2.45.2 |
| 119 | + |
0 commit comments