Skip to content

Commit 8ab4818

Browse files
authored
import iree in compiler workspace instead of tf workspace (#1049)
* import iree in compiler workspace instead of tf workspace related changes: pai-disc/tensorflow#29
1 parent 0b2eae2 commit 8ab4818

File tree

7 files changed

+53
-2
lines changed

7 files changed

+53
-2
lines changed

pytorch_blade/WORKSPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,7 @@ tf_workspace1()
176176
load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")
177177

178178
tf_workspace0()
179+
180+
load("@org_disc_compiler//build_tools/bazel:workspace.bzl", "disc_compiler_workspace")
181+
182+
disc_compiler_workspace()

tao_compiler/WORKSPACE

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
workspace(name = "disc_compiler")
1+
workspace(name = "org_disc_compiler")
22

33
local_repository(
44
name = "org_tensorflow",
@@ -26,3 +26,9 @@ tf_workspace1()
2626
load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")
2727

2828
tf_workspace0()
29+
30+
load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")
31+
32+
load("//build_tools/bazel:workspace.bzl", "disc_compiler_workspace")
33+
34+
disc_compiler_workspace()

tao_compiler/build_tools/bazel/BUILD

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
load("@org_tensorflow//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
2+
3+
4+
def workspace():
5+
tf_http_archive(
6+
name = "iree-dialects",
7+
sha256 = "f6ed70146b85d27c25cb4653cfb879d7954be426516b1cac230cbf5bb8b041da",
8+
strip_prefix = "iree-7cd0a8cb6e1027188faa75b9361c4b10aab4707c/llvm-external-projects/iree-dialects",
9+
urls = tf_mirror_urls("https://github.com/iree-org/iree/archive/7cd0a8cb6e1027188faa75b9361c4b10aab4707c.zip"),
10+
patch_file = ["@org_disc_compiler//third_party/iree:StructuredTransformOpsExt.cpp.patch"],
11+
)
12+
13+
# Alias so it can be loaded without assigning to a different symbol to prevent
14+
# shadowing previous loads and trigger a buildifier warning.
15+
disc_compiler_workspace = workspace
16+

tao_compiler/third_party/iree/BUILD

Whitespace-only changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/lib/Dialect/LinalgTransform/IR/StructuredTransformOpsExt.cpp b/iree-dialects/lib/Dialect/LinalgTransform/IR/StructuredTransformOpsExt.cpp
2+
index 3a09c0297..e9f03a5c3 100644
3+
--- a/lib/Dialect/LinalgTransform/IR/StructuredTransformOpsExt.cpp
4+
+++ b/lib/Dialect/LinalgTransform/IR/StructuredTransformOpsExt.cpp
5+
@@ -590,7 +590,6 @@ forgetUnnecessaryHandles(transform::TransformState &state,
6+
return !handlesUsedAfterTransform[handle];
7+
});
8+
if (allHandlesUnused) {
9+
- listener->removeMappings(payload);
10+
seen.insert(payload);
11+
}
12+
}
13+
@@ -603,10 +602,11 @@ forgetUnnecessaryHandles(transform::TransformState &state,
14+
for (Operation *payload : state.getPayloadOps(result)) {
15+
if (!payload || seen.contains(payload))
16+
continue;
17+
- listener->removeMappings(payload);
18+
seen.insert(payload);
19+
}
20+
}
21+
+
22+
+ for (Operation* payload : seen) listener->removeMappings(payload);
23+
}
24+
25+
DiagnosedSilenceableFailure transform_ext::CanonicalizedSequenceOp::apply(

tf_community

0 commit comments

Comments
 (0)