Skip to content

Commit

Permalink
Add Check dialect to the MLIR adapter.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 647078265
  • Loading branch information
yijie-yang authored and copybara-github committed Jun 26, 2024
1 parent 9e9d170 commit 9743466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/builtin-adapter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ cc_library(
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:ShapeDialect",
"@llvm-project//mlir:Support",
"@stablehlo//:check_ops",
"@stablehlo//:chlo_ops",
"@stablehlo//:stablehlo_ops",
"@stablehlo//:stablehlo_passes",
Expand Down
4 changes: 3 additions & 1 deletion src/builtin-adapter/model_json_graph_convert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ limitations under the License.
#include "stablehlo/dialect/ChloOps.h"
#include "stablehlo/dialect/StablehloOps.h"
#include "stablehlo/dialect/VhloOps.h"
#include "stablehlo/tests/CheckOps.h"
#include "stablehlo/transforms/Passes.h"
#include "tensorflow/cc/saved_model/reader.h"
#include "status_macros.h"
Expand Down Expand Up @@ -352,7 +353,8 @@ absl::StatusOr<std::string> ConvertMlirToJson(const VisualizeConfig& config,
mlir::stablehlo::StablehloDialect, mlir::chlo::ChloDialect,
mlir::mhlo::MhloDialect, mlir::vhlo::VhloDialect,
mlir::func::FuncDialect, mlir::arith::ArithDialect,
mlir::shape::ShapeDialect, mlir::scf::SCFDialect>();
mlir::shape::ShapeDialect, mlir::scf::SCFDialect,
mlir::stablehlo::check::CheckDialect>();
mlir::MLIRContext context(registry);
mlir::ParserConfig parser_config(&context);
std::string model_content;
Expand Down

0 comments on commit 9743466

Please sign in to comment.