Skip to content

Commit

Permalink
Repo sync (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinxc authored Apr 15, 2024
1 parent 8bf3c97 commit ad1461f
Show file tree
Hide file tree
Showing 18 changed files with 1,374 additions and 1 deletion.
2 changes: 2 additions & 0 deletions libspu/compiler/core/core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ void Core::buildPipeline(mlir::PassManager *pm) {
optPM.addPass(mlir::spu::pphlo::createOptimizeSqrtPlusEps());
}

optPM.addPass(mlir::spu::pphlo::createExpandSecretGatherPass());

if (!options.disable_div_sqrt_rewrite()) {
optPM.addPass(mlir::spu::pphlo::createRewriteDivSqrtPatterns());
}
Expand Down
2 changes: 1 addition & 1 deletion libspu/compiler/front_end/hlo_importer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void runHloPasses(xla::HloModule *module) {
/*allow_mixed_precision=*/false);

pipeline.AddPass<GatherSimplifier>();
pipeline.AddPass<GatherExpander>(GatherExpander::kEliminateAllGathers);
pipeline.AddPass<GatherExpander>(GatherExpander::kEliminateSimpleGathers);
pipeline.AddPass<ScatterExpander>(ScatterExpander::kEliminateAllScatters);
pipeline.AddPass<AlgebraicSimplifier>(options);
pipeline.AddPass<BitcastDtypesExpander>();
Expand Down
13 changes: 13 additions & 0 deletions libspu/compiler/passes/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ spu_cc_library(
],
)

spu_cc_library(
name = "expand_secret_gather",
srcs = ["expand_secret_gather.cc"],
hdrs = ["passes.h"],
deps = [
":pass_details",
"//libspu/dialect/pphlo:dialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:TransformUtils",
],
)

spu_cc_library(
name = "hlo_legalize_to_pphlo",
srcs = ["hlo_legalize_to_pphlo.cc"],
Expand Down Expand Up @@ -276,6 +288,7 @@ spu_cc_library(
":convert_push_down",
":decompose_comparison",
":decompose_minmax",
":expand_secret_gather",
":hlo_legalize_to_pphlo",
":insert_deallocation",
":lower_conversion_cast",
Expand Down
Loading

0 comments on commit ad1461f

Please sign in to comment.