diff --git a/.bazelrc b/.bazelrc index 396b84f70b3..528e344d38b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -49,7 +49,6 @@ # rocm: Build with AMD GPU support (rocm). # mkl: Enable full mkl support. # tensorrt: Enable Tensorrt support. -# ngraph: Enable ngraph support. # numa: Enable numa using hwloc. # noaws: Disable AWS S3 storage support # nogcp: Disable GCS support. @@ -218,7 +217,6 @@ build:rocm --define=using_rocm=true --define=using_rocm_hipcc=true build:rocm --action_env TF_NEED_ROCM=1 # Options extracted from configure script -build:ngraph --define=with_ngraph_support=true build:numa --define=with_numa_support=true # Options to disable default on features diff --git a/configure.py b/configure.py index e381c8c20db..26615441811 100644 --- a/configure.py +++ b/configure.py @@ -1487,7 +1487,6 @@ def main(): config_info_line('mkl', 'Build with MKL support.') config_info_line('mkl_aarch64', 'Build with oneDNN support for Aarch64.') config_info_line('monolithic', 'Config for mostly static monolithic build.') - config_info_line('ngraph', 'Build with Intel nGraph support.') config_info_line('numa', 'Build with NUMA support.') config_info_line( 'dynamic_kernels', diff --git a/tensorflow/BUILD b/tensorflow/BUILD index 274a829f575..379b483e5d2 100644 --- a/tensorflow/BUILD +++ b/tensorflow/BUILD @@ -23,10 +23,6 @@ load( "//tensorflow/python/tools/api/generator:api_init_files_v1.bzl", "TENSORFLOW_API_INIT_FILES_V1", # @unused ) -load( - "//third_party/ngraph:build_defs.bzl", - "if_ngraph", -) load( "//third_party/mkl:build_defs.bzl", "if_mkl_ml", @@ -472,14 +468,6 @@ config_setting( visibility = ["//visibility:public"], ) -# This flag is set from the configure step when the user selects with nGraph option. -# By default it should be false -config_setting( - name = "with_ngraph_support", - values = {"define": "with_ngraph_support=true"}, - visibility = ["//visibility:public"], -) - # This flag specifies whether TensorFlow 2.0 API should be built instead # of 1.* API. Note that TensorFlow 2.0 API is currently under development. config_setting( @@ -639,7 +627,6 @@ bzl_library( "//tensorflow/core/platform/default:cuda_build_defs_bzl", "//third_party/mkl:build_defs_bzl", "//third_party/mkl_dnn:build_defs_bzl", - "//third_party/ngraph:build_defs_bzl", "@bazel_skylib//rules:common_settings", "@local_config_cuda//cuda:build_defs_bzl", "@local_config_rocm//rocm:build_defs_bzl", @@ -847,7 +834,7 @@ tf_cc_shared_object( "//tensorflow/cc:scope", "//tensorflow/cc/profiler", "//tensorflow/core:tensorflow", - ] + if_ngraph(["@ngraph_tf//:ngraph_tf"]), + ], ) # ** Targets for Windows build (start) ** diff --git a/tensorflow/opensource_only.files b/tensorflow/opensource_only.files index fca40b774fe..fe5258f4fa5 100644 --- a/tensorflow/opensource_only.files +++ b/tensorflow/opensource_only.files @@ -137,14 +137,6 @@ tensorflow/third_party/nccl/archive.patch tensorflow/third_party/nccl/build_defs.bzl.tpl tensorflow/third_party/nccl/nccl_configure.bzl tensorflow/third_party/nccl/system.BUILD.tpl -tensorflow/third_party/ngraph/BUILD -tensorflow/third_party/ngraph/LICENSE -tensorflow/third_party/ngraph/NGRAPH_LICENSE -tensorflow/third_party/ngraph/build_defs.bzl -tensorflow/third_party/ngraph/ngraph.BUILD -tensorflow/third_party/ngraph/ngraph_tf.BUILD -tensorflow/third_party/ngraph/nlohmann_json.BUILD -tensorflow/third_party/ngraph/tbb.BUILD tensorflow/third_party/opt_einsum.BUILD tensorflow/third_party/pcre.BUILD tensorflow/third_party/png.BUILD @@ -381,4 +373,4 @@ tensorflow/tools/pip_package/simple_console.py tensorflow/tools/pip_package/simple_console_for_windows.py tensorflow/tools/pip_package/xla_build/CMakeLists.txt tensorflow/virtual_root_template_v1.__init__.py -tensorflow/virtual_root_template_v2.__init__.py \ No newline at end of file +tensorflow/virtual_root_template_v2.__init__.py diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD index 21d266fdbdb..43ec875d004 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD @@ -43,10 +43,6 @@ load("//tensorflow:tensorflow.bzl", "tf_py_build_info_genrule") load("//tensorflow/core/platform:build_config.bzl", "pyx_library", "tf_additional_all_protos", "tf_additional_lib_deps", "tf_proto_library", "tf_protos_grappler") # @unused load("//tensorflow/core/platform:build_config_root.bzl", "if_static", "tf_additional_plugin_deps", "tf_additional_profiler_deps", "tf_additional_xla_deps_py") load("//tensorflow/python:build_defs.bzl", "tf_gen_op_wrapper_private_py") -load( - "//third_party/ngraph:build_defs.bzl", - "if_ngraph", -) # TODO(mdan): Break into per-directory files. @@ -6098,9 +6094,7 @@ pywrap_tensorflow_macro( ] + (tf_additional_lib_deps() + tf_monitoring_python_deps() + tf_additional_plugin_deps() + - tf_additional_profiler_deps()) + if_ngraph([ - "@ngraph_tf//:ngraph_tf", - ]) + if_xla_available([ + tf_additional_profiler_deps()) + if_xla_available([ "//tensorflow/compiler/aot:tfcompile_lib", ]) + if_static(extra_deps = ["//tensorflow/core/platform:tensor_float_32_utils"]), ) diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index c5b756a3398..99f4b8ebbf4 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -47,10 +47,6 @@ load( "if_mkl_open_source_only", "if_mkldnn_threadpool", ) -load( - "//third_party/ngraph:build_defs.bzl", - "if_ngraph", -) load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") # version for the shared libraries, can @@ -335,7 +331,6 @@ def tf_copts( if_mkl(["-DINTEL_MKL=1", "-DENABLE_MKLDNN_V1", "-DENABLE_INTEL_MKL_BFLOAT16", "-DINTEL_MKL_DNN_ONLY"]) + if_mkldnn_threadpool(["-DENABLE_MKLDNN_THREADPOOL"]) + if_enable_mkl(["-DENABLE_MKL"]) + - if_ngraph(["-DINTEL_NGRAPH=1"]) + if_android_arm(["-mfpu=neon"]) + if_linux_x86_64(["-msse3"]) + if_ios_x86_64(["-msse4.1"]) + diff --git a/tensorflow/tools/pip_package/BUILD b/tensorflow/tools/pip_package/BUILD index 402bcc642a7..523d4eb5632 100644 --- a/tensorflow/tools/pip_package/BUILD +++ b/tensorflow/tools/pip_package/BUILD @@ -6,7 +6,6 @@ load("//third_party/mkl:build_defs.bzl", "if_mkl", "if_mkl_ml") load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda") load("@local_config_syslibs//:build_defs.bzl", "if_not_system_lib") load("//tensorflow/core/platform:build_config_root.bzl", "tf_additional_license_deps") -load("//third_party/ngraph:build_defs.bzl", "if_ngraph") package(default_visibility = ["//visibility:private"]) @@ -275,12 +274,7 @@ filegroup( "@com_github_grpc_grpc//:LICENSE", "@com_github_grpc_grpc//third_party/address_sorting:LICENSE", ], - ) + if_ngraph([ - "@ngraph//:LICENSE", - "@ngraph_tf//:LICENSE", - "@nlohmann_json_lib//:LICENSE.MIT", - "@tbb//:LICENSE", - ]) + tf_additional_license_deps(), + ) + tf_additional_license_deps(), ) sh_binary( diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl index 20adabf9b36..a86a4145df5 100755 --- a/tensorflow/workspace.bzl +++ b/tensorflow/workspace.bzl @@ -1109,50 +1109,6 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""): ], ) - tf_http_archive( - name = "tbb", - build_file = clean_dep("//third_party/ngraph:tbb.BUILD"), - sha256 = "c3245012296f09f1418b78a8c2f17df5188b3bd0db620f7fd5fabe363320805a", - strip_prefix = "tbb-2019_U1", - urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/01org/tbb/archive/2019_U1.zip", - "https://github.com/01org/tbb/archive/2019_U1.zip", - ], - ) - - tf_http_archive( - name = "ngraph", - build_file = clean_dep("//third_party/ngraph:ngraph.BUILD"), - sha256 = "a1780f24a1381fc25e323b4b2d08b6ef5129f42e011305b2a34dcf43a48030d5", - strip_prefix = "ngraph-0.11.0", - urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/NervanaSystems/ngraph/archive/v0.11.0.tar.gz", - "https://github.com/NervanaSystems/ngraph/archive/v0.11.0.tar.gz", - ], - ) - - tf_http_archive( - name = "nlohmann_json_lib", - build_file = clean_dep("//third_party/ngraph:nlohmann_json.BUILD"), - sha256 = "c377963a95989270c943d522bfefe7b889ef5ed0e1e15d535fd6f6f16ed70732", - strip_prefix = "json-3.4.0", - urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/nlohmann/json/archive/v3.4.0.tar.gz", - "https://github.com/nlohmann/json/archive/v3.4.0.tar.gz", - ], - ) - - tf_http_archive( - name = "ngraph_tf", - build_file = clean_dep("//third_party/ngraph:ngraph_tf.BUILD"), - sha256 = "742a642d2c6622277df4c902b6830d616d0539cc8cd843d6cdb899bb99e66e36", - strip_prefix = "ngraph-tf-0.9.0", - urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/NervanaSystems/ngraph-tf/archive/v0.9.0.zip", - "https://github.com/NervanaSystems/ngraph-tf/archive/v0.9.0.zip", - ], - ) - tf_http_archive( name = "pybind11", urls = [ diff --git a/third_party/ngraph/BUILD b/third_party/ngraph/BUILD deleted file mode 100644 index 922559f68ec..00000000000 --- a/third_party/ngraph/BUILD +++ /dev/null @@ -1,9 +0,0 @@ -licenses(["notice"]) # 3-Clause BSD - -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -bzl_library( - name = "build_defs_bzl", - srcs = ["build_defs.bzl"], - visibility = ["//visibility:public"], -) diff --git a/third_party/ngraph/LICENSE b/third_party/ngraph/LICENSE deleted file mode 100644 index 9c8f3ea0871..00000000000 --- a/third_party/ngraph/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/third_party/ngraph/NGRAPH_LICENSE b/third_party/ngraph/NGRAPH_LICENSE deleted file mode 100644 index 9c8f3ea0871..00000000000 --- a/third_party/ngraph/NGRAPH_LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/third_party/ngraph/build_defs.bzl b/third_party/ngraph/build_defs.bzl deleted file mode 100644 index 3c34be524bc..00000000000 --- a/third_party/ngraph/build_defs.bzl +++ /dev/null @@ -1,11 +0,0 @@ -"""Build configurations for nGraph.""" - -def clean_dep(dep): - return str(Label(dep)) - -def if_ngraph(if_true, if_false = []): - """select()'ing on whether we're building with nGraph support.""" - return select({ - clean_dep("//tensorflow:with_ngraph_support"): if_true, - "//conditions:default": if_false, - }) diff --git a/third_party/ngraph/ngraph.BUILD b/third_party/ngraph/ngraph.BUILD deleted file mode 100644 index 715148d38f6..00000000000 --- a/third_party/ngraph/ngraph.BUILD +++ /dev/null @@ -1,167 +0,0 @@ -licenses(["notice"]) # 3-Clause BSD - -exports_files(["LICENSE"]) - -cc_library( - name = "ngraph_headers", - hdrs = glob(["src/ngraph/**/*.hpp"]), - visibility = ["//visibility:public"], -) - -cc_library( - name = "ngraph_cpu_backend", - srcs = [ - "src/ngraph/runtime/cpu/builder/add.cpp", - "src/ngraph/runtime/cpu/builder/allreduce.cpp", - "src/ngraph/runtime/cpu/builder/argmax.cpp", - "src/ngraph/runtime/cpu/builder/argmin.cpp", - "src/ngraph/runtime/cpu/builder/avg_pool.cpp", - "src/ngraph/runtime/cpu/builder/batch_norm.cpp", - "src/ngraph/runtime/cpu/builder/bounded_relu.cpp", - "src/ngraph/runtime/cpu/builder/broadcast.cpp", - "src/ngraph/runtime/cpu/builder/concat.cpp", - "src/ngraph/runtime/cpu/builder/convert.cpp", - "src/ngraph/runtime/cpu/builder/convert_layout.cpp", - "src/ngraph/runtime/cpu/builder/convolution.cpp", - "src/ngraph/runtime/cpu/builder/dot.cpp", - "src/ngraph/runtime/cpu/builder/function_call.cpp", - "src/ngraph/runtime/cpu/builder/lrn.cpp", - "src/ngraph/runtime/cpu/builder/lstm.cpp", - "src/ngraph/runtime/cpu/builder/matmul_bias.cpp", - "src/ngraph/runtime/cpu/builder/max.cpp", - "src/ngraph/runtime/cpu/builder/max_pool.cpp", - "src/ngraph/runtime/cpu/builder/min.cpp", - "src/ngraph/runtime/cpu/builder/one_hot.cpp", - "src/ngraph/runtime/cpu/builder/pad.cpp", - "src/ngraph/runtime/cpu/builder/product.cpp", - "src/ngraph/runtime/cpu/builder/quantization.cpp", - "src/ngraph/runtime/cpu/builder/quantized_avg_pool.cpp", - "src/ngraph/runtime/cpu/builder/quantized_conv.cpp", - "src/ngraph/runtime/cpu/builder/quantized_max_pool.cpp", - "src/ngraph/runtime/cpu/builder/reduce_function.cpp", - "src/ngraph/runtime/cpu/builder/reduce_function_window.cpp", - "src/ngraph/runtime/cpu/builder/relu.cpp", - "src/ngraph/runtime/cpu/builder/replace_slice.cpp", - "src/ngraph/runtime/cpu/builder/reshape.cpp", - "src/ngraph/runtime/cpu/builder/reverse.cpp", - "src/ngraph/runtime/cpu/builder/reverse_sequence.cpp", - "src/ngraph/runtime/cpu/builder/rnn.cpp", - "src/ngraph/runtime/cpu/builder/select.cpp", - "src/ngraph/runtime/cpu/builder/select_and_scatter.cpp", - "src/ngraph/runtime/cpu/builder/sigmoid.cpp", - "src/ngraph/runtime/cpu/builder/slice.cpp", - "src/ngraph/runtime/cpu/builder/softmax.cpp", - "src/ngraph/runtime/cpu/builder/sum.cpp", - "src/ngraph/runtime/cpu/builder/topk.cpp", - "src/ngraph/runtime/cpu/cpu_backend.cpp", - "src/ngraph/runtime/cpu/cpu_builder.cpp", - "src/ngraph/runtime/cpu/cpu_call_frame.cpp", - "src/ngraph/runtime/cpu/cpu_cse.cpp", - "src/ngraph/runtime/cpu/cpu_executor.cpp", - "src/ngraph/runtime/cpu/cpu_external_function.cpp", - "src/ngraph/runtime/cpu/cpu_kernels.cpp", - "src/ngraph/runtime/cpu/cpu_layout_descriptor.cpp", - "src/ngraph/runtime/cpu/cpu_op_annotations.cpp", - "src/ngraph/runtime/cpu/cpu_tensor_view.cpp", - "src/ngraph/runtime/cpu/cpu_tensor_view_wrapper.cpp", - "src/ngraph/runtime/cpu/cpu_tracing.cpp", - "src/ngraph/runtime/cpu/cpu_visualize_tree.cpp", - "src/ngraph/runtime/cpu/kernel/pad.cpp", - "src/ngraph/runtime/cpu/kernel/reduce_max.cpp", - "src/ngraph/runtime/cpu/kernel/reduce_sum.cpp", - "src/ngraph/runtime/cpu/kernel/reshape.cpp", - "src/ngraph/runtime/cpu/mkldnn_emitter.cpp", - "src/ngraph/runtime/cpu/mkldnn_invoke.cpp", - "src/ngraph/runtime/cpu/mkldnn_utils.cpp", - "src/ngraph/runtime/cpu/op/batch_dot.cpp", - "src/ngraph/runtime/cpu/op/batch_norm_relu.cpp", - "src/ngraph/runtime/cpu/op/bounded_relu.cpp", - "src/ngraph/runtime/cpu/op/conv_add.cpp", - "src/ngraph/runtime/cpu/op/conv_bias.cpp", - "src/ngraph/runtime/cpu/op/conv_relu.cpp", - "src/ngraph/runtime/cpu/op/convert_layout.cpp", - "src/ngraph/runtime/cpu/op/group_conv.cpp", - "src/ngraph/runtime/cpu/op/group_conv_bias.cpp", - "src/ngraph/runtime/cpu/op/halide_op.cpp", - "src/ngraph/runtime/cpu/op/leaky_relu.cpp", - "src/ngraph/runtime/cpu/op/loop_kernel.cpp", - "src/ngraph/runtime/cpu/op/lstm.cpp", - "src/ngraph/runtime/cpu/op/matmul_bias.cpp", - "src/ngraph/runtime/cpu/op/max_pool_with_indices.cpp", - "src/ngraph/runtime/cpu/op/rnn.cpp", - "src/ngraph/runtime/cpu/op/sigmoid_mul.cpp", - "src/ngraph/runtime/cpu/op/update_slice.cpp", - "src/ngraph/runtime/cpu/pass/cpu_assignment.cpp", - "src/ngraph/runtime/cpu/pass/cpu_collapse_dims.cpp", - "src/ngraph/runtime/cpu/pass/cpu_fusion.cpp", - "src/ngraph/runtime/cpu/pass/cpu_horizontal_fusion.cpp", - "src/ngraph/runtime/cpu/pass/cpu_layout.cpp", - "src/ngraph/runtime/cpu/pass/cpu_loop_kernel_fusion.cpp", - "src/ngraph/runtime/cpu/pass/cpu_mat_fusion.cpp", - "src/ngraph/runtime/cpu/pass/cpu_memory_optimization.cpp", - "src/ngraph/runtime/cpu/pass/cpu_post_layout_optimizations.cpp", - "src/ngraph/runtime/cpu/pass/cpu_reshape_sinking.cpp", - "src/ngraph/runtime/cpu/pass/cpu_rnn_fusion.cpp", - "src/ngraph/runtime/cpu/pass/cpu_workspace_insertion.cpp", - ], - hdrs = glob(["src/ngraph/runtime/cpu/**/*.hpp"]) + glob([]), - copts = [ - "-I external/ngraph/src", - "-I external/nlohmann_json_lib/include/", - "-D SHARED_LIB_EXT=\".so\"", - "-D NGRAPH_VERSION=\"0.11.0\"", - "-D NGRAPH_DEX_ONLY", - "-D PROJECT_ROOT_DIR=\"\"", - ], - visibility = ["//visibility:public"], - deps = [ - ":ngraph_headers", - "@eigen_archive//:eigen", - "@mkl_dnn_v1//:mkl_dnn", - "@mkl_dnn_v1//:mkl_dnn_aarch64", - "@nlohmann_json_lib", - "@tbb", - ], - alwayslink = 1, -) - -cc_library( - name = "ngraph_core", - srcs = glob([ - "src/ngraph/*.cpp", - "src/ngraph/autodiff/*.cpp", - "src/ngraph/builder/*.cpp", - "src/ngraph/descriptor/*.cpp", - "src/ngraph/descriptor/layout/*.cpp", - "src/ngraph/op/experimental/generate_mask.cpp", - "src/ngraph/op/experimental/quantized_avg_pool.cpp", - "src/ngraph/op/experimental/quantized_conv_bias.cpp", - "src/ngraph/op/experimental/quantized_conv_relu.cpp", - "src/ngraph/op/experimental/quantized_conv.cpp", - "src/ngraph/op/experimental/quantized_max_pool.cpp", - "src/ngraph/op/experimental/shape_of.cpp", - "src/ngraph/op/*.cpp", - "src/ngraph/op/util/*.cpp", - "src/ngraph/pattern/*.cpp", - "src/ngraph/pattern/*.hpp", - "src/ngraph/pass/*.cpp", - "src/ngraph/pass/*.hpp", - "src/ngraph/runtime/*.cpp", - "src/ngraph/type/*.cpp", - ]), - copts = [ - "-I external/ngraph/src", - "-I external/nlohmann_json_lib/include/", - "-D SHARED_LIB_EXT=\\\".so\\\"", - "-D NGRAPH_VERSION=\\\"0.11.0\\\"", - "-D PROJECT_ROOT_DIR=\\\"\\\"", - ], - visibility = ["//visibility:public"], - deps = [ - ":ngraph_cpu_backend", - ":ngraph_headers", - "@eigen_archive//:eigen", - "@nlohmann_json_lib", - ], - alwayslink = 1, -) diff --git a/third_party/ngraph/ngraph_tf.BUILD b/third_party/ngraph/ngraph_tf.BUILD deleted file mode 100644 index 3ce31feec27..00000000000 --- a/third_party/ngraph/ngraph_tf.BUILD +++ /dev/null @@ -1,99 +0,0 @@ -licenses(["notice"]) # 3-Clause BSD - -exports_files(["LICENSE"]) - -load( - "@org_tensorflow//tensorflow:tensorflow.bzl", - "tf_cc_test", -) - -cc_library( - name = "ngraph_tf", - srcs = [ - "logging/ngraph_log.cc", - "logging/ngraph_log.h", - "logging/tf_graph_writer.cc", - "logging/tf_graph_writer.h", - "src/ngraph_api.cc", - "src/ngraph_api.h", - "src/ngraph_assign_clusters.cc", - "src/ngraph_assign_clusters.h", - "src/ngraph_backend_manager.cc", - "src/ngraph_backend_manager.h", - "src/ngraph_builder.cc", - "src/ngraph_builder.h", - "src/ngraph_capture_variables.cc", - "src/ngraph_capture_variables.h", - "src/ngraph_cluster_manager.cc", - "src/ngraph_cluster_manager.h", - "src/ngraph_conversions.h", - "src/ngraph_deassign_clusters.cc", - "src/ngraph_deassign_clusters.h", - "src/ngraph_encapsulate_clusters.cc", - "src/ngraph_encapsulate_clusters.h", - "src/ngraph_encapsulate_op.cc", - "src/ngraph_freshness_tracker.cc", - "src/ngraph_freshness_tracker.h", - "src/ngraph_mark_for_clustering.cc", - "src/ngraph_mark_for_clustering.h", - "src/ngraph_rewrite_for_tracking.cc", - "src/ngraph_rewrite_for_tracking.h", - "src/ngraph_rewrite_pass.cc", - "src/ngraph_tracked_variable.cc", - "src/ngraph_utils.cc", - "src/ngraph_utils.h", - "src/ngraph_version_utils.h", - "src/tf_deadness_analysis.cc", - "src/tf_deadness_analysis.h", - "src/tf_graphcycles.cc", - "src/tf_graphcycles.h", - ], - copts = [ - "-I external/ngraph_tf/src", - "-I external/ngraph_tf/logging", - "-I external/ngraph/src", - ], - visibility = ["//visibility:public"], - deps = [ - "@com_google_absl//absl/container:container_memory", - "@com_google_absl//absl/container:flat_hash_set", - "@com_google_absl//absl/types:variant", - "@ngraph//:ngraph_core", - "@org_tensorflow//tensorflow/core:framework_headers_lib", - "@org_tensorflow//tensorflow/core/common_runtime:core_cpu_headers_lib", - ], - alwayslink = 1, -) - -tf_cc_test( - name = "ngraph_tf_tests", - size = "small", - srcs = [ - "test/conversions.cpp", - "test/graph_rewrites/assign_clusters.cc", - "test/graph_rewrites/deadness_test.cc", - "test/main.cpp", - "test/opexecuter.cpp", - "test/opexecuter.h", - "test/padding.cpp", - "test/test_array_ops.cpp", - "test/test_math_ops.cpp", - "test/test_nn_ops.cpp", - "test/test_utilities.cpp", - "test/test_utilities.h", - "test/tf_exec.cpp", - ], - extra_copts = [ - "-fexceptions ", - "-I external/ngraph_tf/src", - "-I external/ngraph_tf/logging", - "-I external/ngraph/src", - ], - deps = [ - ":ngraph_tf", - "@com_google_googletest//:gtest", - "@org_tensorflow//tensorflow/cc:cc_ops", - "@org_tensorflow//tensorflow/cc:client_session", - "@org_tensorflow//tensorflow/core:tensorflow", - ], -) diff --git a/third_party/ngraph/tbb.BUILD b/third_party/ngraph/tbb.BUILD deleted file mode 100644 index c78a2d79ddf..00000000000 --- a/third_party/ngraph/tbb.BUILD +++ /dev/null @@ -1,63 +0,0 @@ -licenses(["notice"]) # 3-Clause BSD - -exports_files(["LICENSE"]) - -# Taken from: https://github.com/rnburn/satyr/blob/master/bazel/tbb.BUILD -# License for this BUILD file: MIT -# See: https://github.com/rnburn/satyr/blob/master/LICENSE -# -# License for TBB: Apache 2.0 -# See: https://github.com/01org/tbb/blob/tbb_2018/LICENSE - -genrule( - name = "build_tbb", - srcs = glob(["**"]) + [ - "@local_config_cc//:toolchain", - ], - outs = [ - "libtbb.a", - "libtbbmalloc.a", - ], - cmd = """ - set -e - WORK_DIR=$$PWD - DEST_DIR=$$PWD/$(@D) - export PATH=$$(dirname $(AR)):$$PATH - export CXXFLAGS=$(CC_FLAGS) - export NM=$(NM) - export AR=$(AR) - cd $$(dirname $(location :Makefile)) - - #TBB's build needs some help to figure out what compiler it's using - if $$CXX --version | grep clang &> /dev/null; then - COMPILER_OPT="compiler=clang" - else - COMPILER_OPT="compiler=gcc" - - # # Workaround for TBB bug - # # See https://github.com/01org/tbb/issues/59 - # CXXFLAGS="$$CXXFLAGS -flifetime-dse=1" - fi - - # uses extra_inc=big_iron.inc to specify that static libraries are - # built. See https://software.intel.com/en-us/forums/intel-threading-building-blocks/topic/297792 - make tbb_build_prefix="build" \ - extra_inc=big_iron.inc \ - $$COMPILER_OPT; \ - - echo cp build/build_{release,debug}/*.a $$DEST_DIR - cp build/build_{release,debug}/*.a $$DEST_DIR - cd $$WORK_DIR - """, -) - -cc_library( - name = "tbb", - srcs = ["libtbb.a"], - hdrs = glob([ - "include/serial/**", - "include/tbb/**/**", - ]), - includes = ["include"], - visibility = ["//visibility:public"], -) diff --git a/third_party/ngraph/nlohmann_json.BUILD b/third_party/nlohmann_json.BUILD similarity index 100% rename from third_party/ngraph/nlohmann_json.BUILD rename to third_party/nlohmann_json.BUILD