Skip to content

Commit dca5cec

Browse files
authored
Enable GPU tests in the TestSuite (#482)
* Enable GPU tests in the TestSuite * Enable one more test on GPU * Use levelzero runtime for tests * Add a flag to enable/disable GPU tests * Remove print * Fix CI Co-authored-by: [email protected] <Nishant Patel>
1 parent f9f8af6 commit dca5cec

File tree

118 files changed

+458
-416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+458
-416
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ include(AddLLVM)
7979
include(AddMLIR)
8080
include(HandleLLVMOptions)
8181

82+
set(IMEX_ENABLE_SYCL_RUNTIME 0 CACHE BOOL "Enable the Sycl Runtime")
83+
set(IMEX_ENABLE_L0_RUNTIME 0 CACHE BOOL "Enable the Level Zero Runtime")
84+
85+
8286
# Check if mlir vulkan runner was configured from mlir
8387
# target mlir-vulkan-runner is only set if vulkan runner was enabled during
8488
# mlir configuration
@@ -114,9 +118,6 @@ add_subdirectory(lib)
114118
add_subdirectory(tools)
115119
add_subdirectory(test)
116120

117-
set(IMEX_ENABLE_SYCL_RUNTIME 0 CACHE BOOL "Enable the Sycl Runtime")
118-
set(IMEX_ENABLE_L0_RUNTIME 0 CACHE BOOL "Enable the Level Zero Runtime")
119-
120121
option(IMEX_INCLUDE_DOCS "Generate build targets for the IMEX docs." ON)
121122
if (IMEX_INCLUDE_DOCS)
122123
add_subdirectory(docs)

test/Jax/gordon/jit__logsm_from_logmhalo_jax_kern_0_before_linalg.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner mlir-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2-
// RUN-GPU: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3-
// RUN-GPU: --runner mlir-cpu-runner -e main \
4-
// RUN-GPU: --entry-point-result=void \
5-
// RUN-GPU: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
2+
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3+
// RUN: --runner mlir-cpu-runner -e main \
4+
// RUN: --entry-point-result=void \
5+
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
66

77
#map0 = affine_map<() -> ()>
88
#map1 = affine_map<(d0) -> ()>

test/Jax/gordon/lit.local.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if config.gpu_skip == 'true':
2+
config.substitutions.append(('%gpu_skip', 'true'))
3+
else:
4+
config.substitutions.append(('%gpu_skip', 'false'))

test/Jax/janet/jit__get_age_weights_from_tables.8_linalg.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner mlir-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2-
// RUN-GPU: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3-
// RUN-GPU: --runner mlir-cpu-runner -e main \
4-
// RUN-GPU: --entry-point-result=void \
5-
// RUN-GPU: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
2+
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3+
// RUN: --runner mlir-cpu-runner -e main \
4+
// RUN: --entry-point-result=void \
5+
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
66

77
#map0 = affine_map<(d0) -> (d0)>
88
#map1 = affine_map<(d0) -> ()>

test/Jax/janet/jit__get_lgt_birth.7_linalg.mlir

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner mlir-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2+
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3+
// RUN: --runner mlir-cpu-runner -e main \
4+
// RUN: --entry-point-result=void \
5+
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
26

37
#map0 = affine_map<(d0) -> ()>
48
#map1 = affine_map<(d0) -> (d0)>

test/Jax/janet/jit__get_met_weights_singlegal.43_linalg.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner mlir-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2-
// RUN-GPU: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3-
// RUN-GPU: --runner mlir-cpu-runner -e main \
4-
// RUN-GPU: --entry-point-result=void \
5-
// RUN-GPU: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
2+
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3+
// RUN: --runner mlir-cpu-runner -e main \
4+
// RUN: --entry-point-result=void \
5+
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
66

77
#map0 = affine_map<(d0) -> (d0)>
88
#map1 = affine_map<(d0) -> ()>

test/Jax/janet/jit__net_loss.91_linalg.mlir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner mlir-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2-
// RUN-GPU: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3-
// RUN-GPU: --runner mlir-cpu-runner -e main \
4-
// RUN-GPU: --entry-point-result=void \
5-
// RUN-GPU: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
2+
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3+
// RUN: --runner mlir-cpu-runner -e main \
4+
// RUN: --entry-point-result=void \
5+
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
66

77
#map0 = affine_map<(d0, d1) -> (d1)>
88
#map1 = affine_map<(d0, d1) -> (d0, d1)>
@@ -539,7 +539,7 @@ module @jit__net_loss.91 {
539539
func.call @printMemrefF32(%unranked) : (tensor<*xf32>) -> ()
540540
// CHECK: Unranked Memref base@ = {{(0x)?[-9a-f]*}}
541541
// CHECK-SAME: rank = 0 offset = 0 sizes = [] strides = [] data =
542-
// CHECK: [0.000133295]
542+
// CHECK: [0.00013329{{.*}}]
543543
return
544544
}
545545
}

test/Jax/janet/jit__unit_scale_traindata.47_linalg.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-cpu.pp --runner mlir-cpu-runner -e main --shared-libs=%mlir_runner_utils --entry-point-result=void | FileCheck %s
2-
// RUN-GPU: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3-
// RUN-GPU: --runner mlir-cpu-runner -e main \
4-
// RUN-GPU: --entry-point-result=void \
5-
// RUN-GPU: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
2+
// RUN: %gpu_skip || %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
3+
// RUN: --runner mlir-cpu-runner -e main \
4+
// RUN: --entry-point-result=void \
5+
// RUN: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
66

77
#map0 = affine_map<(d0) -> (d0)>
88
#map1 = affine_map<(d0, d1) -> (d0)>

test/Jax/janet/jit_prim_fun.50_linalg.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN-GPU: %python_executable %imex_runner -i %s --pass-pipeline-file=%p/linalg-to-llvm.pp \
33
// RUN-GPU: --runner mlir-cpu-runner -e main \
44
// RUN-GPU: --entry-point-result=void \
5-
// RUN-GPU: --shared-libs=%mlir_runner_utils,%sycl_runtime | FileCheck %s
5+
// RUN-GPU: --shared-libs=%mlir_runner_utils,%levelzero_runtime | FileCheck %s
66

77
#map = affine_map<(d0, d1) -> (d0, d1)>
88
module @jit_prim_fun.50 {

test/Jax/janet/lit.local.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
local_excludes = ['jit__get_age_weights_from_tables.8_linalg.mlir']
22
config.excludes.update(local_excludes)
3+
4+
if config.gpu_skip == 'true':
5+
config.substitutions.append(('%gpu_skip', 'true'))
6+
else:
7+
config.substitutions.append(('%gpu_skip', 'false'))

0 commit comments

Comments
 (0)