Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 5066c1c

Browse files
committed
TEST_GPU_ARCH
1 parent b0efdf4 commit 5066c1c

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

tests/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
set(TEST_GPU_ARCH "xe_lpg" CACHE STRING "Set gpu_arch to test. Options: xe_lpg,xe_hpg,xe_hpc")
2+
string(TOUPPER "${TEST_GPU_ARCH}" TEST_GPU_ARCH)
3+
add_compile_definitions("TEST_GPU_ARCH_${TEST_GPU_ARCH}")
4+
15
add_subdirectory(./integration)
26
add_subdirectory(./unit)

tests/integration/fmha/fmha.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ void fmha_run_(const test_params_t& p, uint32_t iter, uint32_t warmup) {
239239
using fmha_forward_op_t = gpu::xetla::fmha::fmha_forward_t<
240240
policy_t,
241241
FMHA_T,
242-
gpu_arch::XeLpg,
242+
TEST_GPU_ARCH,
243243
false,
244244
kUseBias,
245245
false,

tests/integration/gemv/int4/main.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class test_col_major_1 {
4646
static constexpr size_t global_kslicing = 1;
4747
static constexpr mem_layout layout_a = mem_layout::row_major;
4848
static constexpr mem_layout layout_b = mem_layout::col_major;
49-
static constexpr mma_engine mma_eng = mma_engine::fpu;
50-
static constexpr gpu_arch arch = gpu_arch::XeLpg;
49+
static constexpr mma_engine mma_eng =
50+
arch_has_xmx<TEST_GPU_ARCH> ? mma_engine::xmx : mma_engine::fpu;
5151
using data_type_a = scalar_t;
5252
using data_type_b = int4x8;
5353
using data_type_c = scalar_t;
@@ -72,7 +72,6 @@ class test_col_major_2 {
7272
static constexpr mem_layout layout_a = mem_layout::row_major;
7373
static constexpr mem_layout layout_b = mem_layout::col_major;
7474
static constexpr mma_engine mma_eng = mma_engine::fpu;
75-
static constexpr gpu_arch arch = gpu_arch::XeLpg;
7675
using data_type_a = fp16;
7776
using data_type_b = int4x8;
7877
using data_type_c = fp16;
@@ -297,22 +296,22 @@ void dequantize_gemv_run(int iter) {
297296
data_type_zero_pt,
298297
quant_info,
299298
Test::mma_eng,
300-
Test::arch>;
299+
TEST_GPU_ARCH>;
301300

302301
using gemm_t = xetla::group::
303302
gemm_t<compute_policy, tile_shape, mem_desc_a_t, mem_desc_b_t>;
304303

305304
using bias_op_t =
306-
gpu::xetla::subgroup::bias_add_op_t<mem_desc_bias_t, Test::arch>;
305+
gpu::xetla::subgroup::bias_add_op_t<mem_desc_bias_t, TEST_GPU_ARCH>;
307306

308307
using tile_op_t = gpu::xetla::subgroup::chained_tile_op_t<bias_op_t>;
309308

310309
using epilogue_t = xetla::group::epilogue_t<
311-
xetla::group::epilogue_policy_tile_op<tile_op_t, Test::arch>,
310+
xetla::group::epilogue_policy_tile_op<tile_op_t, TEST_GPU_ARCH>,
312311
tile_shape,
313312
mem_desc_c_t>;
314313

315-
using group_swizzle = xetla::kernel::group_swizzle_default<Test::arch>;
314+
using group_swizzle = xetla::kernel::group_swizzle_default<TEST_GPU_ARCH>;
316315

317316
using gemm_op_t = xetla::kernel::gemm_universal_t<
318317
gpu::xetla::kernel::dispatch_policy_int4_dequantize_kslicing<

tests/utils/utils.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,13 @@
2121
#include "execution.hpp"
2222
#include "gemm_gen.hpp"
2323
#include "profiling.hpp"
24+
25+
#if defined(TEST_GPU_ARCH_XE_LPG)
26+
inline constexpr gpu_arch TEST_GPU_ARCH = gpu_arch::XeLpg;
27+
#elif defined(TEST_GPU_ARCH_XE_HPG)
28+
inline constexpr gpu_arch TEST_GPU_ARCH = gpu_arch::XeHpg;
29+
#elif defined(TEST_GPU_ARCH_XE_HPC)
30+
inline constexpr gpu_arch TEST_GPU_ARCH = gpu_arch::XeHpc;
31+
#else
32+
static_assert(false, "TEST_GPU_ARCH not defined");
33+
#endif

0 commit comments

Comments
 (0)