Skip to content

Remove RUN line duplication in mlir/test/Integration/Dialect/SparseTensor/CPU/ #60628

Open
@banach-space

Description

@banach-space

When extending SparseCompiler integrations tests to run via SVE codegen (see https://reviews.llvm.org/D143514 and https://reviews.llvm.org/D121304), we effectively duplicated many of the RUN lines.

More specifically, if the MLIR_RUN_ARM_SVE_TESTS CMake flag is disabled, the following RUN lines are effectively identical (they verify similar code-path):

  1. // REDEFINE: %{option} = "enable-runtime-library=false enable-buffer-initialization=true vl=2 reassociate-fp-reductions=true enable-index-optimizations=true"
    // RUN: %{compile} | %{run}
  2. // REDEFINE: %{option} = "enable-runtime-library=false vl=4 enable-buffer-initialization=true reassociate-fp-reductions=true enable-index-optimizations=true enable-arm-sve=%ENABLE_VLA"
    // REDEFINE: %{run} = %lli \
    // REDEFINE: --entry-function=entry_lli \
    // REDEFINE: --extra-module=%S/Inputs/main_for_lli.ll \
    // REDEFINE: %VLA_ARCH_ATTR_OPTIONS \
    // REDEFINE: --dlopen=%mlir_native_utils_lib_dir/libmlir_c_runner_utils%shlibext | \
    // REDEFINE: FileCheck %s
    // RUN: %{compile} | mlir-translate -mlir-to-llvmir | %{run}

We should avoid this. My suggestion would be to replace both RUN lines with RUN line 2. above. Additionally, we should make sure that there are public buildbots that

  • set MLIR_RUN_ARM_SVE_TESTS to On (e.g. clang-aarch64-sve-vla
  • set MLIR_RUN_ARM_SVE_TESTS to Off (that's the default, so any buildbot running MLIR integration tests should be fine, e.g. mlir-rocm-mi200

This way we will be making sure that all configurations are tested, but there is not code duplication in tests. WDYT?

CC @aartbik

-Andrzej

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions