From 27aa7c86e064faed0e61a6c3660c729dadaaa799 Mon Sep 17 00:00:00 2001 From: Sambhav Jain Date: Wed, 29 Nov 2023 09:51:13 -0800 Subject: [PATCH] [LLVM Integrate] Bump {stablehlo, torch-mlir, llvm} and remove `stablehlo.patch` (#22) Now that https://github.com/openxla/stablehlo/pull/1810 has landed, the stablehlo.patch is no longer needed. - [x] Bump torch-mlir once https://github.com/llvm/torch-mlir/pull/2598 lands. --- deps.bzl | 16 ++---- stablehlo.patch | 145 ------------------------------------------------ 2 files changed, 6 insertions(+), 155 deletions(-) delete mode 100644 stablehlo.patch diff --git a/deps.bzl b/deps.bzl index 41d9ba93..7507fc10 100644 --- a/deps.bzl +++ b/deps.bzl @@ -22,8 +22,8 @@ def third_party_deps(): path = local_llvm_repo_path(), ) else: - LLVM_COMMIT = "28b27c1b10ae8d1f5b4fb9df691e8cf0da9be3f6" - LLVM_SHA256 = "1f7a7ca5983801d671901644659c32d028e5e7316418fabcb6159454249aefa3" + LLVM_COMMIT = "5e5a22caf88ac1ccfa8dc5720295fdeba0ad9372" + LLVM_SHA256 = "9d9ae8ae30f6262ca0823493893398ea2ab6fbd49027e338e06ac7c25bb8caf4" http_archive( name = "llvm-raw", build_file_content = "# empty", @@ -39,8 +39,8 @@ def third_party_deps(): path = local_torch_mlir_repo_path(), ) else: - TORCH_MLIR_COMMIT = "52abae1526e51ae8c415ca98ce4a56b00782b68b" - TORCH_MLIR_SHA256 = "f9973f3519b4ba98475917eb700f447b65fee88e9dd60c61f174ce38335ccb3b" + TORCH_MLIR_COMMIT = "44f6942796536a7cf2eee37ec383c9db74fa853f" + TORCH_MLIR_SHA256 = "168b9eebeee2754d7a804eae9465c84adf7b4019344e2a4a2594799ecbfff4f0" http_archive( name = "torch-mlir-raw", sha256 = TORCH_MLIR_SHA256, @@ -55,17 +55,13 @@ def third_party_deps(): path = local_stablehlo_repo_path(), ) else: - STABLEHLO_COMMIT = "5a8bb985f50a679721292b14f97f270344ac64a3" - STABLEHLO_SHA256 = "abda3e8e029c1409b53b1eea080e5cfb4c4ef6705064d7cd954d8272d059567a" + STABLEHLO_COMMIT = "83f095e7217c897f1eccac5652600ceb944cb0e0" + STABLEHLO_SHA256 = "bd31b22048ce214d191678d294a05495071167abea60f89e0578d4db346aa0fd" http_archive( name = "stablehlo", sha256 = STABLEHLO_SHA256, strip_prefix = "stablehlo-" + STABLEHLO_COMMIT, urls = ["https://github.com/openxla/stablehlo/archive/{commit}.tar.gz".format(commit = STABLEHLO_COMMIT)], - # Note: This patch allows testing stablehlo from mlir-tcp - # TODO: Remove after https://github.com/openxla/stablehlo/pull/1810 lands - patches = ["@//:stablehlo.patch"], - patch_args = ["-p1"], ) SKYLIB_VERSION = "1.3.0" diff --git a/stablehlo.patch b/stablehlo.patch deleted file mode 100644 index d1dd3180..00000000 --- a/stablehlo.patch +++ /dev/null @@ -1,145 +0,0 @@ -diff --git a/BUILD.bazel b/BUILD.bazel -index 36d1c5a25b..e127c8cc82 100644 ---- a/BUILD.bazel -+++ b/BUILD.bazel -@@ -1311,3 +1311,12 @@ gentbl_cc_library( - ":vhlo_ops_td_files", - ], - ) -+ -+test_suite( -+ name = "all_tests", -+ tests = [ -+ "//stablehlo/tests:stablehlo_tests", -+ "//stablehlo/testdata:stablehlo_data_tests", -+ "//stablehlo/conversions/tosa/tests:stablehlo_tosa_tests" -+ ], -+) -diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel -index 776cd5ca09..f395aa1164 100644 ---- a/WORKSPACE.bazel -+++ b/WORKSPACE.bazel -@@ -13,6 +13,8 @@ - # limitations under the License. - """Workspace for StableHLO.""" - -+workspace(name = "stablehlo") -+ - load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - - SKYLIB_VERSION = "1.3.0" -diff --git a/stablehlo/conversions/tosa/tests/BUILD.bazel b/stablehlo/conversions/tosa/tests/BUILD.bazel -index 9304c1ad54..cdbc35e111 100644 ---- a/stablehlo/conversions/tosa/tests/BUILD.bazel -+++ b/stablehlo/conversions/tosa/tests/BUILD.bazel -@@ -27,8 +27,8 @@ expand_template( - substitutions = { - "@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.", - "@LLVM_TOOLS_DIR@": package_path("@llvm-project//llvm:BUILD"), -- "@STABLEHLO_TOOLS_DIR@": ".", -- "@STABLEHLO_SOURCE_DIR@": ".", -+ "\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')", -+ "\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')", - }, - template = "lit.site.cfg.py.in", - ) -@@ -45,6 +45,12 @@ expand_template( - "@llvm-project//llvm:FileCheck", - ], - size = "small", -+ tags = ["stablehlo_tosa_tests"], - ) - for src in glob(["**/*.mlir"]) - ] -+ -+test_suite( -+ name = "stablehlo_tosa_tests", -+ tags = ["stablehlo_tosa_tests"], -+) -diff --git a/stablehlo/conversions/tosa/tests/lit.site.cfg.py.in b/stablehlo/conversions/tosa/tests/lit.site.cfg.py.in -index bc65774850..bfa327d5ae 100644 ---- a/stablehlo/conversions/tosa/tests/lit.site.cfg.py.in -+++ b/stablehlo/conversions/tosa/tests/lit.site.cfg.py.in -@@ -17,4 +17,4 @@ import lit.llvm - lit.llvm.initialize(lit_config, config) - config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" - config.stablehlo_tools_dir = "@STABLEHLO_TOOLS_DIR@" --lit_config.load_config(config, "@STABLEHLO_SOURCE_DIR@/stablehlo/conversions/tosa/tests/lit.cfg.py") -+lit_config.load_config(config, "@STABLEHLO_SOURCE_DIR@" + "/stablehlo/conversions/tosa/tests/lit.cfg.py") -diff --git a/stablehlo/testdata/BUILD.bazel b/stablehlo/testdata/BUILD.bazel -index 1b34e94532..913ca509fd 100644 ---- a/stablehlo/testdata/BUILD.bazel -+++ b/stablehlo/testdata/BUILD.bazel -@@ -27,8 +27,8 @@ expand_template( - substitutions = { - "@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.", - "@LLVM_TOOLS_DIR@": package_path("@llvm-project//llvm:BUILD"), -- "@STABLEHLO_TOOLS_DIR@": ".", -- "@STABLEHLO_SOURCE_DIR@": ".", -+ "\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')", -+ "\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')", - }, - template = "lit.site.cfg.py.in", - ) -@@ -46,6 +46,13 @@ expand_template( - "@llvm-project//llvm:FileCheck", - ], - size = "small", -+ tags = ["stablehlo_data_tests"], -+ - ) - for src in glob(["**/*.mlir"]) - ] -+ -+test_suite( -+ name = "stablehlo_data_tests", -+ tags = ["stablehlo_data_tests"], -+) -diff --git a/stablehlo/testdata/lit.site.cfg.py.in b/stablehlo/testdata/lit.site.cfg.py.in -index b78557087d..d1da209331 100644 ---- a/stablehlo/testdata/lit.site.cfg.py.in -+++ b/stablehlo/testdata/lit.site.cfg.py.in -@@ -18,4 +18,4 @@ import lit.llvm - lit.llvm.initialize(lit_config, config) - config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" - config.stablehlo_tools_dir = "@STABLEHLO_TOOLS_DIR@" --lit_config.load_config(config, "@STABLEHLO_SOURCE_DIR@/stablehlo/testdata/lit.cfg.py") -+lit_config.load_config(config, "@STABLEHLO_SOURCE_DIR@" + "/stablehlo/testdata/lit.cfg.py") -diff --git a/stablehlo/tests/BUILD.bazel b/stablehlo/tests/BUILD.bazel -index 968627d42e..50b74ce351 100644 ---- a/stablehlo/tests/BUILD.bazel -+++ b/stablehlo/tests/BUILD.bazel -@@ -130,8 +130,8 @@ expand_template( - substitutions = { - "@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.", - "@LLVM_TOOLS_DIR@": package_path("@llvm-project//llvm:BUILD"), -- "@STABLEHLO_TOOLS_DIR@": ".", -- "@STABLEHLO_SOURCE_DIR@": ".", -+ "\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')", -+ "\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')", - }, - template = "lit.site.cfg.py.in", - ) -@@ -150,6 +150,12 @@ expand_template( - "@llvm-project//llvm:not", - ] + glob(["%s.bc" % src]), - size = "small", -+ tags = ["stablehlo_tests"], - ) - for src in glob(["**/*.mlir"]) - ] -+ -+test_suite( -+ name = "stablehlo_tests", -+ tags = ["stablehlo_tests"], -+) -diff --git a/stablehlo/tests/lit.site.cfg.py.in b/stablehlo/tests/lit.site.cfg.py.in -index 6f916bf766..75537da56d 100644 ---- a/stablehlo/tests/lit.site.cfg.py.in -+++ b/stablehlo/tests/lit.site.cfg.py.in -@@ -18,4 +18,4 @@ import lit.llvm - lit.llvm.initialize(lit_config, config) - config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" - config.stablehlo_tools_dir = "@STABLEHLO_TOOLS_DIR@" --lit_config.load_config(config, "@STABLEHLO_SOURCE_DIR@/stablehlo/tests/lit.cfg.py") -+lit_config.load_config(config, "@STABLEHLO_SOURCE_DIR@" + "/stablehlo/tests/lit.cfg.py") \ No newline at end of file