diff --git a/.bazelversion b/.bazelversion index f22d756da..f3b5af39e 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.5.0 +6.1.1 diff --git a/Dockerfile b/Dockerfile index 18bd4541f..2bbff2990 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,7 +67,7 @@ RUN pip3 install tf_slim RUN ln -s /usr/bin/python3 /usr/bin/python # Install bazel -ARG BAZEL_VERSION=6.5.0 +ARG BAZEL_VERSION=6.1.1 RUN mkdir /bazel && \ wget --no-check-certificate -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/b\ azel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \ diff --git a/WORKSPACE b/WORKSPACE index e7f04c400..fd13e9b35 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -59,23 +59,6 @@ http_archive( url = "https://github.com/bazelbuild/rules_java/releases/download/5.3.5/rules_java-5.3.5.tar.gz", ) -http_archive( - name = "rules_python", - sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b", - strip_prefix = "rules_python-0.26.0", - url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -py_repositories() - -python_register_toolchains( - name = "python", - ignore_root_user_error = True, - python_version = "3.10", -) - http_archive( name = "com_google_protobuf", sha256 = "87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422", @@ -98,13 +81,13 @@ http_archive( ], ) -# XNNPACK on 2024-06-04. +# XNNPACK on 2024-03-27. http_archive( name = "XNNPACK", # `curl -L | shasum -a 256` - sha256 = "dac478307dd076e3fa7b9e66348df9365606b4fd52208ca1abdfbf2974ef8501", - strip_prefix = "XNNPACK-b66e1d7bf428c61e8d454e3f90c50b88d688c3f5", - url = "https://github.com/google/XNNPACK/archive/b66e1d7bf428c61e8d454e3f90c50b88d688c3f5.zip", + sha256 = "179a680ef85deb5380b850f2551b214e00835c232f5b197dedf7c011a6adf5a6", + strip_prefix = "XNNPACK-2fe25b859581a34e77b48b06c640ac1a5a58612e", + url = "https://github.com/google/XNNPACK/archive/2fe25b859581a34e77b48b06c640ac1a5a58612e.zip", ) # TODO: This is an are indirect depedency. We should factor it out. @@ -547,10 +530,10 @@ http_archive( ) # TensorFlow repo should always go after the other external dependencies. -# TF on 2024-06-13. -_TENSORFLOW_GIT_COMMIT = "366fc67018c3f0e6020ed58a73bf45d6a37f9b83" -# curl -L https://github.com/tensorflow/tensorflow/archive/366fc67018c3f0e6020ed58a73bf45d6a37f9b83.tar.gz | shasum -a 256 -_TENSORFLOW_SHA256 = "590e89a687f08ef06c4bf2c270dc32e08e41e183df7a00c9e3a8a4cc35d3ccb9" +# TF on 2024-05-09. +_TENSORFLOW_GIT_COMMIT = "8038e44ea38bb889095afaaf6ad05e94adaed8d2" +# curl -L https://github.com/tensorflow/tensorflow/archive/8038e44ea38bb889095afaaf6ad05e94adaed8d2.tar.gz | shasum -a 256 +_TENSORFLOW_SHA256 = "a00c1503a879eb21c349941bbee54aef8d557d7d2ab770e76fb26668d75aa6e0" http_archive( name = "org_tensorflow", urls = [ @@ -696,3 +679,4 @@ http_archive( urls = ["https://github.com/nlohmann/json/releases/download/v3.9.1/include.zip"], build_file = "@//third_party:nlohmann.BUILD", ) + diff --git a/third_party/org_tensorflow_system_python.diff b/third_party/org_tensorflow_system_python.diff index d6a13442b..9895f7474 100644 --- a/third_party/org_tensorflow_system_python.diff +++ b/third_party/org_tensorflow_system_python.diff @@ -52,7 +52,7 @@ index 19cdd37ed4f..b4253b49a61 100644 "//tensorflow/lite/core/c:common", ], diff --git a/tensorflow/lite/core/c/BUILD b/tensorflow/lite/core/c/BUILD -index 018b6e1004c..cf355612386 100644 +index 1b0bccb9e48..cd391a21b0b 100644 --- a/tensorflow/lite/core/c/BUILD +++ b/tensorflow/lite/core/c/BUILD @@ -378,7 +378,6 @@ tflite_cc_library_with_c_headers_test( @@ -95,3 +95,56 @@ index 018b6e1004c..cf355612386 100644 ":c_api_types", ":c_api_without_op_resolver_without_alwayslink", ":common", +diff --git a/tensorflow/tools/toolchains/cpus/aarch64/aarch64_compiler_configure.bzl b/tensorflow/tools/toolchains/cpus/aarch64/aarch64_compiler_configure.bzl +index 00cd6983ca3..d9c5ef16f9b 100644 +--- a/tensorflow/tools/toolchains/cpus/aarch64/aarch64_compiler_configure.bzl ++++ b/tensorflow/tools/toolchains/cpus/aarch64/aarch64_compiler_configure.bzl +@@ -1,7 +1,7 @@ + """Configurations of AARCH64 builds used with Docker container.""" + + load("//tensorflow/tools/toolchains:cpus/aarch64/aarch64.bzl", "remote_aarch64_configure") +-load("//third_party/py:python_configure.bzl", "remote_python_configure") ++load("//third_party/py/non_hermetic:python_configure.bzl", "remote_python_configure") + load("//third_party/remote_config:remote_platform_configure.bzl", "remote_platform_configure") + + def ml2014_tf_aarch64_configs(name_container_map, env): + +diff --git a/tensorflow/tools/toolchains/remote_config/rbe_config.bzl b/tensorflow/tools/toolchains/remote_config/rbe_config.bzl +index ae776c2a2fd..108e79edbd7 100644 +--- a/tensorflow/tools/toolchains/remote_config/rbe_config.bzl ++++ b/tensorflow/tools/toolchains/remote_config/rbe_config.bzl +@@ -4,7 +4,7 @@ load("//tensorflow/tools/toolchains/remote_config:containers.bzl", "containers") + load("//third_party/gpus:cuda_configure.bzl", "remote_cuda_configure") + load("//third_party/gpus:rocm_configure.bzl", "remote_rocm_configure") + load("//third_party/nccl:nccl_configure.bzl", "remote_nccl_configure") +-load("//third_party/py:python_configure.bzl", "local_python_configure", "remote_python_configure") ++load("//third_party/py/non_hermetic:python_configure.bzl", "local_python_configure", "remote_python_configure") + load("//third_party/remote_config:remote_platform_configure.bzl", "remote_platform_configure") + load("//third_party/tensorrt:tensorrt_configure.bzl", "remote_tensorrt_configure") + +diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl +index 056df85ffdb..7422baf8c59 100644 +--- a/tensorflow/workspace2.bzl ++++ b/tensorflow/workspace2.bzl +@@ -37,7 +37,7 @@ load("//third_party/nasm:workspace.bzl", nasm = "repo") + load("//third_party/nccl:nccl_configure.bzl", "nccl_configure") + load("//third_party/opencl_headers:workspace.bzl", opencl_headers = "repo") + load("//third_party/pasta:workspace.bzl", pasta = "repo") +-load("//third_party/py:python_configure.bzl", "python_configure") ++load("//third_party/py/non_hermetic:python_configure.bzl", "python_configure") + load("//third_party/py/ml_dtypes:workspace.bzl", ml_dtypes = "repo") + load("//third_party/pybind11_abseil:workspace.bzl", pybind11_abseil = "repo") + load("//third_party/pybind11_bazel:workspace.bzl", pybind11_bazel = "repo") +diff --git a/third_party/py/non_hermetic/python_configure.bzl b/third_party/py/non_hermetic/python_configure.bzl +index 89732c3e33d..4ac1c8f5c04 100644 +--- a/third_party/py/non_hermetic/python_configure.bzl ++++ b/third_party/py/non_hermetic/python_configure.bzl +@@ -203,7 +203,7 @@ def _create_local_python_repository(repository_ctx): + # Resolve all labels before doing any real work. Resolving causes the + # function to be restarted with all previous state being lost. This + # can easily lead to a O(n^2) runtime in the number of labels. +- build_tpl = repository_ctx.path(Label("//third_party/py:BUILD.tpl")) ++ build_tpl = repository_ctx.path(Label("//third_party/py/non_hermetic:BUILD.tpl")) + + python_bin = get_python_bin(repository_ctx) + _check_python_bin(repository_ctx, python_bin)