-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move xla::gpu::mlir_converter namespace to xla::emitters namespace.
The code is not gpu specific. Also move the code to a corresponding directory. PiperOrigin-RevId: 713622540
- Loading branch information
1 parent
18a3b63
commit c0dfe97
Showing
33 changed files
with
415 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
load("//xla:xla.bzl", "xla_cc_test") | ||
|
||
package( | ||
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"], | ||
default_visibility = [":friends"], | ||
licenses = ["notice"], | ||
) | ||
|
||
package_group( | ||
name = "friends", | ||
includes = [ | ||
"//xla:friends", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "computation_partitioner", | ||
srcs = ["computation_partitioner.cc"], | ||
hdrs = ["computation_partitioner.h"], | ||
deps = [ | ||
":type_util", | ||
"//xla:shape_util", | ||
"//xla:util", | ||
"//xla/hlo/analysis:indexing_analysis", | ||
"//xla/hlo/ir:hlo", | ||
"//xla/service/llvm_ir:llvm_util", | ||
"@com_google_absl//absl/algorithm:container", | ||
"@com_google_absl//absl/container:flat_hash_map", | ||
"@com_google_absl//absl/container:flat_hash_set", | ||
"@com_google_absl//absl/container:node_hash_map", | ||
"@com_google_absl//absl/log:check", | ||
"@com_google_absl//absl/strings", | ||
"@com_google_absl//absl/types:span", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:DataLayoutInterfaces", | ||
"@llvm-project//mlir:FuncDialect", | ||
"@llvm-project//mlir:IR", | ||
"@llvm-project//mlir:LLVMDialect", | ||
"@llvm-project//mlir:Support", | ||
], | ||
) | ||
|
||
xla_cc_test( | ||
name = "computation_partitioner_test", | ||
srcs = ["computation_partitioner_test.cc"], | ||
deps = [ | ||
":computation_partitioner", | ||
"//xla/hlo/analysis:indexing_analysis", | ||
"//xla/hlo/ir:hlo", | ||
"//xla/tests:hlo_test_base", | ||
"//xla/tests:xla_internal_test_main", | ||
"@com_google_googletest//:gtest", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:FuncDialect", | ||
"@llvm-project//mlir:IR", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "elemental_hlo_to_mlir", | ||
srcs = ["elemental_hlo_to_mlir.cc"], | ||
hdrs = ["elemental_hlo_to_mlir.h"], | ||
deps = [ | ||
":computation_partitioner", | ||
":type_util", | ||
"//xla:comparison_util", | ||
"//xla:shape_util", | ||
"//xla:status_macros", | ||
"//xla:xla_data_proto_cc", | ||
"//xla/codegen/ir:xla", | ||
"//xla/hlo/analysis:indexing_analysis", | ||
"//xla/hlo/ir:hlo", | ||
"//xla/hlo/translate/hlo_to_mhlo:hlo_utils", | ||
"//xla/hlo/utils:hlo_traversal", | ||
"//xla/mlir_hlo", | ||
"//xla/mlir_hlo:map_mhlo_to_scalar_op", | ||
"//xla/service:algorithm_util", | ||
"//xla/stream_executor:device_description", | ||
"@com_google_absl//absl/algorithm:container", | ||
"@com_google_absl//absl/container:flat_hash_map", | ||
"@com_google_absl//absl/container:flat_hash_set", | ||
"@com_google_absl//absl/container:node_hash_map", | ||
"@com_google_absl//absl/log", | ||
"@com_google_absl//absl/log:check", | ||
"@com_google_absl//absl/status", | ||
"@com_google_absl//absl/status:statusor", | ||
"@com_google_absl//absl/strings", | ||
"@com_google_absl//absl/strings:str_format", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:AffineDialect", | ||
"@llvm-project//mlir:AffineUtils", | ||
"@llvm-project//mlir:ArithDialect", | ||
"@llvm-project//mlir:ComplexDialect", | ||
"@llvm-project//mlir:DataLayoutInterfaces", | ||
"@llvm-project//mlir:FuncDialect", | ||
"@llvm-project//mlir:IR", | ||
"@llvm-project//mlir:SCFDialect", | ||
"@llvm-project//mlir:Support", | ||
"@llvm-project//mlir:TensorDialect", | ||
"@llvm-project//mlir:VectorDialect", | ||
"@tsl//tsl/platform:errors", | ||
"@tsl//tsl/platform:statusor", | ||
], | ||
) | ||
|
||
xla_cc_test( | ||
name = "elemental_hlo_to_mlir_test", | ||
srcs = ["elemental_hlo_to_mlir_test.cc"], | ||
deps = [ | ||
":computation_partitioner", | ||
":elemental_hlo_to_mlir", | ||
"//xla:status_macros", | ||
"//xla/backends/gpu/codegen/ir:xla_gpu", | ||
"//xla/codegen/ir:xla", | ||
"//xla/hlo/analysis:indexing_analysis", | ||
"//xla/hlo/ir:hlo", | ||
"//xla/hlo/parser:hlo_parser", | ||
"//xla/hlo/testlib:filecheck", | ||
"//xla/mlir_hlo", | ||
"//xla/service/llvm_ir:llvm_util", | ||
"//xla/tests:hlo_test_base", | ||
"//xla/tests:xla_internal_test_main", | ||
"//xla/tsl/lib/core:status_test_util", | ||
"@com_google_absl//absl/status", | ||
"@com_google_googletest//:gtest", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:AffineDialect", | ||
"@llvm-project//mlir:ArithDialect", | ||
"@llvm-project//mlir:AsmParser", | ||
"@llvm-project//mlir:DLTIDialect", | ||
"@llvm-project//mlir:FuncDialect", | ||
"@llvm-project//mlir:IR", | ||
"@llvm-project//mlir:LLVMDialect", | ||
"@llvm-project//mlir:MathDialect", | ||
"@llvm-project//mlir:Pass", | ||
"@llvm-project//mlir:SCFDialect", | ||
"@llvm-project//mlir:TensorDialect", | ||
"@llvm-project//mlir:Transforms", | ||
"@tsl//tsl/platform:errors", | ||
"@tsl//tsl/platform:statusor", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "type_util", | ||
srcs = ["type_util.cc"], | ||
hdrs = ["type_util.h"], | ||
deps = [ | ||
"//xla:shape_util", | ||
"//xla:xla_data_proto_cc", | ||
"//xla/hlo/translate/hlo_to_mhlo:hlo_utils", | ||
"//xla/mlir/utils:type_util", | ||
"@com_google_absl//absl/log:check", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:IR", | ||
], | ||
) | ||
|
||
xla_cc_test( | ||
name = "type_util_test", | ||
srcs = ["type_util_test.cc"], | ||
deps = [ | ||
":type_util", | ||
"//xla:shape_util", | ||
"//xla:xla_data_proto_cc", | ||
"//xla/tests:xla_internal_test_main", | ||
"@com_google_googletest//:gtest", | ||
"@llvm-project//llvm:Support", | ||
"@llvm-project//mlir:IR", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.