Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[CPU] Enable 'iree-llvmcpu-reassociate-fp-reductions' by default" #13713

Merged
merged 1 commit into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/iree/compiler/Codegen/LLVMCPU/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static llvm::cl::opt<bool> clEnableMicrokernelsDecomposeLinalgGeneric(
static llvm::cl::opt<bool> clEnableReassociateFpReductions(
"iree-llvmcpu-reassociate-fp-reductions",
llvm::cl::desc("Enables reassociation for FP reductions"),
llvm::cl::init(true));
llvm::cl::init(false));

static llvm::cl::opt<bool> clInstrumentMemoryAccesses{
"iree-llvmcpu-instrument-memory-accesses",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ hal.executable private @check_no_cse {
}
// CHECK-LABEL: func.func @check_no_cse()
// CHECK-NOT: memref.alloc
// CHECK: scf.for
// CHECK: arith.addf
// CHECK: vector.reduction <add>
// CHECK: arith.divf
// CHECK: memref.store
// CHECK: %[[FOR:.+]] = scf.for
// CHECK: %[[DIVF:.+]] = arith.divf %[[FOR]]
// CHECK: %[[RES:.+]] = vector.extract %[[DIVF]]
// CHECK: memref.store %[[RES]]

// -----

Expand Down Expand Up @@ -546,8 +545,8 @@ hal.executable private @mmt4d_ukernel {
hal.executable private @ukernel_pass_through {
hal.executable.variant public @embedded_elf_x86_64, target = <
"llvm-cpu", "embedded-elf-x86_64", {
cpu = "generic", cpu_features = "",
data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
cpu = "generic", cpu_features = "",
data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128",
native_vector_size = 16 : index, target_triple = "x86_64-unknown-unknown-eabi-elf",
ukernels = false}> {
hal.executable.export public @dispatch ordinal(0) layout(#hal.pipeline.layout<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: iree-opt --pass-pipeline='builtin.module(hal.executable(hal.executable.variant(iree-llvmcpu-lower-executable-target)))' --iree-llvmcpu-reassociate-fp-reductions=false --split-input-file %s | FileCheck %s
// RUN: iree-opt --pass-pipeline='builtin.module(hal.executable(hal.executable.variant(iree-llvmcpu-lower-executable-target)))' --split-input-file %s | FileCheck %s
// RUN: iree-opt --pass-pipeline='builtin.module(hal.executable(hal.executable.variant(iree-llvmcpu-lower-executable-target)))' --iree-llvmcpu-reassociate-fp-reductions=true --split-input-file %s | FileCheck %s --check-prefix=REORDERCHECK

#executable_target_embedded_elf_x86_64_ = #hal.executable.target<"llvm-cpu", "embedded-elf-x86_64", {cpu_features = "", data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", native_vector_size = 16 : index, target_triple = "x86_64-unknown-unknown-eabi-elf"}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ hal.executable private @preset_config_reduction {
}

// CHECK-LABEL: func.func @mask_dynamic_reduction
// CHECK: vector.maskedload
// CHECK: vector.mask %{{.*}} { vector.reduction <add>
// CHECK-COUNT-5: vector.maskedload
// CHECK-COUNT-4: vector.mask %{{.*}} { vector.reduction <add>
// CHECK: vector.maskedstore

// -----

Expand Down
14 changes: 1 addition & 13 deletions tests/e2e/regression/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,10 @@ iree_lit_test_suite(
],
)

iree_check_single_backend_test_suite(
name = "check_fp_reassoc_regression_llvm-cpu",
srcs = [
"associative_reordering.mlir",
],
compiler_flags = [
"--iree-input-type=mhlo",
"--iree-llvmcpu-reassociate-fp-reductions=false",
],
driver = "local-task",
target_backend = "llvm-cpu",
)

iree_check_single_backend_test_suite(
name = "check_regression_llvm-cpu",
srcs = [
"associative_reordering.mlir",
"layernorm.mlir",
"lowering_config.mlir",
"pack_pad_transpose_1x9_into_2x4x8x4_issue_12546.mlir",
Expand Down
15 changes: 1 addition & 14 deletions tests/e2e/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,11 @@ iree_lit_test_suite(
"hostonly"
)

iree_check_single_backend_test_suite(
NAME
check_fp_reassoc_regression_llvm-cpu
SRCS
"associative_reordering.mlir"
TARGET_BACKEND
"llvm-cpu"
DRIVER
"local-task"
COMPILER_FLAGS
"--iree-input-type=mhlo"
"--iree-llvmcpu-reassociate-fp-reductions=false"
)

iree_check_single_backend_test_suite(
NAME
check_regression_llvm-cpu
SRCS
"associative_reordering.mlir"
"dynamic_abs.mlir"
"dynamic_add.mlir"
"dynamic_dot.mlir"
Expand Down