[Mlir-commits] [mlir] [mlir][test] Make SME e2e tests require an emulator (PR #86489)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Mar 26 06:01:56 PDT 2024


https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/86489

>From 199a5b5bda9b511ed8714dbc789cd2807be2e140 Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Mon, 25 Mar 2024 11:10:00 +0000
Subject: [PATCH 1/3] [mlir][test] Make SME e2e tests require an emulator

Integration tests for ArmSME require an emulator (there's no hardware
available). Disable the tests when an emulator is not available.

I'm also adding a note in the docs for future reference.
---
 mlir/docs/Dialects/ArmSME.md                              | 8 ++++++++
 .../Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg   | 4 ++++
 .../Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg   | 4 ++++
 3 files changed, 16 insertions(+)

diff --git a/mlir/docs/Dialects/ArmSME.md b/mlir/docs/Dialects/ArmSME.md
index 7326150bcd1156..66f62d07a78545 100644
--- a/mlir/docs/Dialects/ArmSME.md
+++ b/mlir/docs/Dialects/ArmSME.md
@@ -14,6 +14,14 @@ integration tests for reference:
 * [Linalg/CPU/ArmSME/matmul.mlir](https://github.com/llvm/llvm-project/blob/main/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir)
 * [Vector/CPU/ArmSME/test-outerproduct-f64.mlir](https://github.com/llvm/llvm-project/blob/main/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/test-outerproduct-f64.mlir)
 
+In order to run ArmSME integration tests, include these flags in the CMake
+invokation when configuring LLVM and MLIR:
+```bash
+  -DMLIR_INCLUDE_INTEGRATION_TESTS=On
+  -DMLIR_RUN_ARM_SME_TESTS=On
+  -DARM_EMULATOR_EXECUTABLE=<path-to-emulator> 
+```
+
 These tests are run "post-commit" by the
 [clang-aarch64-sve-vla](https://lab.llvm.org/buildbot/#/builders/197) LLVM
 BuildBot worker.
diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg
index 296b4419438e8a..083574b1af74d4 100644
--- a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg
+++ b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg
@@ -4,6 +4,10 @@ import sys
 if not config.mlir_run_arm_sme_tests:
     config.unsupported = True
 
+# With no hardware available, ArmSME tests require emulation.
+if not config.arm_emulator_executable:
+    config.unsupported = True
+
 # No JIT on win32.
 if sys.platform == "win32":
     config.unsupported = True
diff --git a/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg b/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg
index 296b4419438e8a..083574b1af74d4 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg
+++ b/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg
@@ -4,6 +4,10 @@ import sys
 if not config.mlir_run_arm_sme_tests:
     config.unsupported = True
 
+# With no hardware available, ArmSME tests require emulation.
+if not config.arm_emulator_executable:
+    config.unsupported = True
+
 # No JIT on win32.
 if sys.platform == "win32":
     config.unsupported = True

>From 891e2fc0a047ef5448ff9dac7e5e03740738edbe Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Tue, 26 Mar 2024 11:37:22 +0000
Subject: [PATCH 2/3] fixup! [mlir][test] Make SME e2e tests require an
 emulator

Switch to using CMake instead
---
 mlir/test/CMakeLists.txt                                     | 5 +++++
 .../test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg | 4 ----
 .../test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg | 4 ----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
index baf07ea1f010ac..88b88116def6eb 100644
--- a/mlir/test/CMakeLists.txt
+++ b/mlir/test/CMakeLists.txt
@@ -39,6 +39,11 @@ if (MLIR_INCLUDE_INTEGRATION_TESTS)
   option(MLIR_RUN_ARM_SVE_TESTS "Run Arm SVE tests.")
   option(MLIR_RUN_ARM_SME_TESTS "Run Arm SME tests.")
 
+  # With no ArmSME hardware available today, we need to make sure that ArmSME
+  # e2e are only run when an emulator has been set.
+  if (MLIR_RUN_ARM_SME_TESTS AND ARM_EMULATOR_EXECUTABLE STREQUAL "")
+    message(FATAL_ERROR "MLIR_RUN_SME_TESTS requires an emuator, but ARM_EMULATOR_EXECUTABLE is not set")
+  endif()
 
   # The native target may not be enabled when cross compiling, raise an error.
   if(NOT MLIR_ENABLE_EXECUTION_ENGINE)
diff --git a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg
index 083574b1af74d4..296b4419438e8a 100644
--- a/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg
+++ b/mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/lit.local.cfg
@@ -4,10 +4,6 @@ import sys
 if not config.mlir_run_arm_sme_tests:
     config.unsupported = True
 
-# With no hardware available, ArmSME tests require emulation.
-if not config.arm_emulator_executable:
-    config.unsupported = True
-
 # No JIT on win32.
 if sys.platform == "win32":
     config.unsupported = True
diff --git a/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg b/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg
index 083574b1af74d4..296b4419438e8a 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg
+++ b/mlir/test/Integration/Dialect/Vector/CPU/ArmSME/lit.local.cfg
@@ -4,10 +4,6 @@ import sys
 if not config.mlir_run_arm_sme_tests:
     config.unsupported = True
 
-# With no hardware available, ArmSME tests require emulation.
-if not config.arm_emulator_executable:
-    config.unsupported = True
-
 # No JIT on win32.
 if sys.platform == "win32":
     config.unsupported = True

>From 85b819b174a218481efa7214c88f0fdb6ded7fbe Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Tue, 26 Mar 2024 13:01:24 +0000
Subject: [PATCH 3/3] fixup! fixup! [mlir][test] Make SME e2e tests require an
 emulator

Fix typos
---
 mlir/test/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
index 88b88116def6eb..711cd98928b80e 100644
--- a/mlir/test/CMakeLists.txt
+++ b/mlir/test/CMakeLists.txt
@@ -42,7 +42,7 @@ if (MLIR_INCLUDE_INTEGRATION_TESTS)
   # With no ArmSME hardware available today, we need to make sure that ArmSME
   # e2e are only run when an emulator has been set.
   if (MLIR_RUN_ARM_SME_TESTS AND ARM_EMULATOR_EXECUTABLE STREQUAL "")
-    message(FATAL_ERROR "MLIR_RUN_SME_TESTS requires an emuator, but ARM_EMULATOR_EXECUTABLE is not set")
+    message(FATAL_ERROR "MLIR_RUN_ARM_SME_TESTS requires an emulator, but ARM_EMULATOR_EXECUTABLE is not set")
   endif()
 
   # The native target may not be enabled when cross compiling, raise an error.



More information about the Mlir-commits mailing list