Moving OutlineConstantsPass to flow and adding parameter support. (#17303)
This allows us to hide the stream dialect attributes from frontends and
use inline flow.tensor.constant ops with parameter attrs. Outlining now
also properly preserves hoistable attrs such as stream affinity. By
running IPO at the head of the flow pipeline we gain fusion
opportunities for hoisted (by user or by global opt) constants and then
we clean up the inlined constants at the end of flow so that the stream
dialect can handle all values consistently.
diff --git a/tools/test/parameters_scoped.mlir b/tools/test/parameters_scoped.mlir
index 2bc7c9e..9b294ab 100644
--- a/tools/test/parameters_scoped.mlir
+++ b/tools/test/parameters_scoped.mlir
@@ -14,10 +14,10 @@
// provide content for a single scope but not to have a single file provide
// content for multiple scopes. Since parameter keys only need to be unique
// within a scope this test could use the same name for both scopes if needed.
-util.global private @a0 = #stream.parameter.named<"a"::"a0"> : tensor<4xi64>
-util.global private @a1 = #stream.parameter.named<"a"::"a1"> : tensor<4xi64>
-util.global private @b0 = #stream.parameter.named<"b"::"b0"> : tensor<8xi64>
-util.global private @b1 = #stream.parameter.named<"b"::"b1"> : tensor<8xi64>
+util.global private @a0 = #flow.parameter.named<"a"::"a0"> : tensor<4xi64>
+util.global private @a1 = #flow.parameter.named<"a"::"a1"> : tensor<4xi64>
+util.global private @b0 = #flow.parameter.named<"b"::"b0"> : tensor<8xi64>
+util.global private @b1 = #flow.parameter.named<"b"::"b1"> : tensor<8xi64>
func.func @echo() -> (tensor<4xi64>, tensor<4xi64>, tensor<8xi64>, tensor<8xi64>) {
%a0 = util.global.load @a0 : tensor<4xi64>
%a1 = util.global.load @a1 : tensor<4xi64>
diff --git a/tools/test/parameters_unscoped.mlir b/tools/test/parameters_unscoped.mlir
index 933cb77..715f686 100644
--- a/tools/test/parameters_unscoped.mlir
+++ b/tools/test/parameters_unscoped.mlir
@@ -12,10 +12,10 @@
// Simple named parameters with no scope. Parameter files are combined at
// runtime to allow for filesystem sharding while still providing a flat set of
// parameters in the compiler input.
-util.global private @a0 = #stream.parameter.named<"a0"> : tensor<4xi64>
-util.global private @a1 = #stream.parameter.named<"a1"> : tensor<4xi64>
-util.global private @b0 = #stream.parameter.named<"b0"> : tensor<8xi64>
-util.global private @b1 = #stream.parameter.named<"b1"> : tensor<8xi64>
+util.global private @a0 = #flow.parameter.named<"a0"> : tensor<4xi64>
+util.global private @a1 = #flow.parameter.named<"a1"> : tensor<4xi64>
+util.global private @b0 = #flow.parameter.named<"b0"> : tensor<8xi64>
+util.global private @b1 = #flow.parameter.named<"b1"> : tensor<8xi64>
func.func @echo() -> (tensor<4xi64>, tensor<4xi64>, tensor<8xi64>, tensor<8xi64>) {
%a0 = util.global.load @a0 : tensor<4xi64>
%a1 = util.global.load @a1 : tensor<4xi64>