Skip to content

Commit

Permalink
Run stablehlo tests only when feature is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
uazizTT committed Aug 20, 2024
1 parent adfade4 commit 8c9e97f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
-DCMAKE_BUILD_TYPE=${{ matrix.build.build_type }} \
-DTTMLIR_ENABLE_RUNTIME=${{ matrix.build.enable_runtime }} \
-DTTMLIR_ENABLE_RUNTIME_TESTS=${{ matrix.build.enable_runtime }} \
-DTTMLIR_ENABLE_STABLEHLO=ON \
-S ${{ steps.strings.outputs.work-dir }}
- name: Build
Expand Down
4 changes: 4 additions & 0 deletions test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)

# Stablehlo tests can be optionally enabled.
if config.enable_stablehlo:
config.available_features.add("stablehlo")

# suffixes: A list of file extensions to treat as test files.
config.suffixes = [".mlir"]

Expand Down
1 change: 1 addition & 0 deletions test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ config.mlir_obj_dir = "@MLIR_BINARY_DIR@"
config.enable_bindings_python = @MLIR_ENABLE_BINDINGS_PYTHON@ and "@TTMLIR_ENABLE_BINDINGS_PYTHON@" == "ON"
config.ttmlir_obj_root = "@TTMLIR_BINARY_DIR@"
config.llvm_shlib_ext = "@SHLIBEXT@"
config.enable_stablehlo = "@TTMLIR_ENABLE_STABLEHLO@" and "@TTMLIR_ENABLE_STABLEHLO@" == "ON"

import lit.llvm
lit.llvm.initialize(lit_config, config)
Expand Down
1 change: 1 addition & 0 deletions test/ttmlir/Dialect/TTIR/stablehlo_to_ttir_addop.mlir
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: stablehlo
// RUN: ttmlir-opt --convert-stablehlo-to-ttir %s | FileCheck %s
#any_device = #tt.operand_constraint<dram|l1|scalar|tile|any_device|any_device_tile>
module @jit_eltwise_add attributes {} {
Expand Down

0 comments on commit 8c9e97f

Please sign in to comment.