diff --git a/Makefile b/Makefile index d1479b8..b759fff 100644 --- a/Makefile +++ b/Makefile @@ -49,8 +49,10 @@ endif EDGETPU_RUNTIME_DIR := /tmp/edgetpu_runtime #LIBUSB_URL := https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.7z #LIBUSB_SHA256 := 620cec4dbe4868202949294157da5adb75c9fbb4f04266146fc833eef85f90fb -LIBUSB_URL := https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z -LIBUSB_SHA256 := 19835e290f46fab6bd8ce4be6ab7dc5209f1c04bad177065df485e51dc4118c8 +#LIBUSB_URL := https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z +#LIBUSB_SHA256 := 19835e290f46fab6bd8ce4be6ab7dc5209f1c04bad177065df485e51dc4118c8 +LIBUSB_URL := https://github.com/libusb/libusb/releases/download/v1.0.29/libusb-1.0.29.7z +LIBUSB_SHA256 := 964a38152ca9a104cd00ec8d2f0617b89cd814f9b635e29763c68563d951521d USBDK_URL := https://github.com/daynix/UsbDk/releases/download/v1.00-22/UsbDk_1.0.22_x64.msi USBDK_SHA256 := 91f6f695e1e13c656024e6d3b55620bf08d8835ef05ee0496935ba6bb62466a5 LIBEDGETPU_BIN ?= $(MAKEFILE_DIR)/out/ @@ -172,7 +174,7 @@ chmod a+w /; \ groupadd --gid $(shell id -g) $(shell id -g -n); \ useradd -m -e '' -s /bin/bash --gid $(shell id -g) --uid $(shell id -u) $(shell id -u -n); \ echo '$(shell id -u -n) ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers; \ -su $(shell id -u -n) $(if $(1),-c '$(1)',) +su $(if $(1),-c '$(1)',) endef docker-image: diff --git a/README.md b/README.md index a8f85cc..23a26ba 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ debuild -us -uc -tc -b -a amd64 -d ``` ### Bazel -The version of `bazel` needs to be the same as that recommended for the corresponding version of tensorflow. For example, it requires `Bazel 6.5.0` to compile TF 2.16.1. +The version of `bazel` needs to be the same as that recommended for the corresponding version of tensorflow. For example, it requires `Bazel 6.5.0` to compile TF 2.19.1. -Current version of tensorflow supported is `2.16.1`. +The current version of Tensorflow supported is `2.19.1`. Build native binaries on Linux and macOS: ``` @@ -61,6 +61,12 @@ $ CPU=armv7a make $ CPU=aarch64 make ``` +Cross-compile for Apple Silicon (arm64), or Intel (x86_64) on MacOS: +``` +$ CPU=darwin_arm64 make +$ CPU=darwin_x86_64 make +``` + To package a Debian deb: ``` debuild -us -uc -tc -b @@ -77,18 +83,42 @@ Repeat compilation. If only building for native systems, it is possible to significantly reduce the complexity of the build by removing Bazel (and Docker). This simple approach builds only what is needed, removes build-time depenency fetching, increases the speed, and uses upstream Debian packages. -To prepare your system, you'll need the following packages (both available on Debian Bookworm, Bullseye or Buster-Backports): +To prepare your system, you'll need the following packages: ``` sudo apt install libabsl-dev libflatbuffers-dev ``` -Next, you'll need to clone the [Tensorflow Repo](https://github.com/tensorflow/tensorflow) at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF2.15, we can check that [tag in the TF Repo](https://github.com/tensorflow/tensorflow/tree/r2.15) get the latest commit for that stable release and then checkout that address: +For Ubuntu 24.10 or newer you also need: +``` +sudo apt install libflatbuffers-dev +``` +For previous versions, you need a newer version of `libflatbuffers-dev` than the one available from the distribution: + +``` +git clone https://github.com/google/flatbuffers.git +cd flatbuffers/ +git checkout v23.5.26 +mkdir build && cd build +cmake .. -DFLATBUFFERS_BUILD_SHAREDLIB=ON -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr +make +sudo make install +``` + + +Next, you'll need to clone the [Tensorflow Repo](https://github.com/tensorflow/tensorflow) at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF 2.19.1, we can check that [tag in the TF Repo](https://github.com/tensorflow/tensorflow/tree/r2.19) get the latest commit for that stable release and then checkout that address: ``` git clone https://github.com/tensorflow/tensorflow -git checkout v2.16.1 +git checkout v2.19.1 +``` + +To build the library for Debian/Ubuntu: +``` +TFROOT=/ LD_LIBRARY_PATH=/usr/local/lib/ make -f makefile_build/Makefile libedgetpu-throttled +TFROOT=/ LD_LIBRARY_PATH=/usr/local/lib/ make -f makefile_build/Makefile libedgetpu-throttled +debuild -us -uc -tc -b -a amd64 -d ``` -To build the library: +To build the library for MacOS: ``` TFROOT= make -f makefile_build/Makefile -j$(nproc) libedgetpu ``` @@ -116,3 +146,4 @@ Google does not accept any responsibility for any loss or damage if the device is operated outside of the recommended ambient temperature range. Note: This issue affects only USB-based Coral devices, and is irrelevant for PCIe devices. +ß diff --git a/WORKSPACE b/WORKSPACE index 3d031a4..4f81301 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -47,7 +47,12 @@ load( "python_repository", ) -python_repository(name = "python_version_repo") +#python_repository(name = "python_version_repo") + +local_repository( + name = "python_version_repo", + path = "local_repo/python_version_repo" +) load("@python_version_repo//:py_version.bzl", "HERMETIC_PYTHON_VERSION") diff --git a/debian/changelog b/debian/changelog index d0f73ba..e31f458 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,18 @@ +libedgetpu (16.0tf2.19.1-1) stable; urgency=medium + * Build against TF v2.19.1 +-- Nicola Ferralis Mon, 17 Sep 2025 12:34:40 -0400 +libedgetpu (16.0tf2.18.1-1) stable; urgency=medium + * Build against TF v2.18.1 +-- Nicola Ferralis Mon, 17 Sep 2025 11:33:39 -0400 +libedgetpu (16.0tf2.17.1-1) stable; urgency=medium + * Build against TF v2.17.1 +-- Nicola Ferralis Mon, 24 Oct 2024 11:33:39 -0400 +libedgetpu (16.0tf2.17.0-1) stable; urgency=medium + * Build against TF v2.17.0 +-- Nicola Ferralis < feranick@hotmail.com> Fri, 12 Jul 2024 09:41:18 -0400 libedgetpu (16.0tf2.16.1-1) stable; urgency=medium * Build against TF v2.16.1 --- Nicola Ferralis < feranick@hotmail.com> Thu, 07 Mar 2024 14:01:34 -0500 +-- Nicola Ferralis Thu, 07 Mar 2024 14:01:34 -0500 libedgetpu (16.0tf2.15.0-1) stable; urgency=medium * Build against TF v2.15.0 -- Nicola Ferralis Tue, 31 Jan 2024 09:10:34 -0500 diff --git a/docker/Dockerfile b/docker/Dockerfile index 0fcbcb4..450f821 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -45,9 +45,17 @@ RUN apt-get update \ wget \ git \ tree \ - software-properties-common \ $(grep Ubuntu /etc/os-release > /dev/null && echo vim-common || echo xxd) +# Debian Trixie +RUN if grep 'trixie' /etc/os-release > /dev/null; then \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + binutils-gold \ + binutils-gold-aarch64-linux-gnu \ + binutils-gold-arm-linux-gnueabihf \ + && export TF_PYTHON_VERSION=3.13; \ + fi + # Bionic Beaver == Ubuntu 18.04 RUN if grep 'Bionic Beaver' /etc/os-release > /dev/null; then \ add-apt-repository ppa:ubuntu-toolchain-r/test \ diff --git a/docker/Dockerfile.windows b/docker/Dockerfile.windows index 89d5cd5..b5c7fe7 100644 --- a/docker/Dockerfile.windows +++ b/docker/Dockerfile.windows @@ -28,26 +28,26 @@ RUN choco install -y 7zip RUN setx /M PATH $($Env:PATH + ';C:\Program Files\7-Zip') # Install msys2 -ARG MSYS_VERSION=20240113 +ARG MSYS_VERSION=20250830 ADD http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-${MSYS_VERSION}.tar.xz c:/windows/temp RUN 7z.exe x c:\windows\temp\msys2-base-x86_64-$env:MSYS_VERSION.tar.xz RUN 7z.exe x c:\msys2-base-x86_64-$env:MSYS_VERSION.tar -o"c:\\" RUN setx /M PATH $($Env:PATH + ';C:\msys64\usr\bin') # Install patch -ARG PATCH_VERSION=2.7.6-1 +ARG PATCH_VERSION=2.7.6-3 ADD http://repo.msys2.org/msys/x86_64/patch-${PATCH_VERSION}-x86_64.pkg.tar.xz c:/windows/temp RUN 7z.exe x -y c:\windows\temp\patch-$env:PATCH_VERSION-x86_64.pkg.tar.xz RUN 7z.exe x -y c:\patch-$env:PATCH_VERSION-x86_64.pkg.tar -o"c:\\msys64" # Install vim (for xxd) -ARG VIM_VERSION=9.1.0000-1 +ARG VIM_VERSION=9.1.1730-1 ADD http://repo.msys2.org/msys/x86_64/vim-${VIM_VERSION}-x86_64.pkg.tar.zst c:/windows/temp RUN 7z.exe x -y c:\windows\temp\vim-$env:VIM_VERSION-x86_64.pkg.tar.zst RUN 7z.exe x -y c:\vim-$env:VIM_VERSION-x86_64.pkg.tar -o"c:\\msys64" # Install libusb release package -ARG LIBUSB_VERSION=1.0.27 +ARG LIBUSB_VERSION=1.0.29 ADD https://github.com/libusb/libusb/releases/download/v${LIBUSB_VERSION}/libusb-${LIBUSB_VERSION}.7z c:/windows/temp RUN 7z x -oc:\libusb c:\windows\temp\libusb-$env:LIBUSB_VERSION.7z diff --git a/docker/update_sources.sh b/docker/update_sources.sh index 19ddaa1..7913d7e 100755 --- a/docker/update_sources.sh +++ b/docker/update_sources.sh @@ -18,8 +18,47 @@ sed -i "s/deb\ /deb \[arch=amd64\]\ /g" /etc/apt/sources.list +if [ ${UBUNTU_CODENAME} == "noble" ]; then + +echo "NOBLE" + +rm /etc/apt/sources.list.d/ubuntu.sources +cat <> /etc/apt/sources.list.d/ubuntu.sources + +Types: deb +URIs: http://archive.ubuntu.com/ubuntu/ +Suites: ${UBUNTU_CODENAME} ${UBUNTU_CODENAME}-updates ${UBUNTU_CODENAME}-backports +Components: main universe restricted multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg +Architectures: amd64 + +## Ubuntu security updates. Aside from URIs and Suites, +## this should mirror your choices in the previous section. +Types: deb +URIs: http://security.ubuntu.com/ubuntu/ +Suites: ${UBUNTU_CODENAME}-security +Components: main universe restricted multiverse +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg +Architectures: amd64 + +Types: deb +URIs: http://ports.ubuntu.com/ubuntu-ports +Suites: ${UBUNTU_CODENAME} ${UBUNTU_CODENAME}-updates ${UBUNTU_CODENAME}-security +Components: main universe +Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg +Architectures: arm64 armhf + +EOT + +else + cat <> /etc/apt/sources.list deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${UBUNTU_CODENAME} main universe deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${UBUNTU_CODENAME}-updates main universe deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports ${UBUNTU_CODENAME}-security main universe EOT + +fi + + + diff --git a/local_repo/python_version_repo/BUILD b/local_repo/python_version_repo/BUILD new file mode 100755 index 0000000..e69de29 diff --git a/local_repo/python_version_repo/WORKSPACE b/local_repo/python_version_repo/WORKSPACE new file mode 100644 index 0000000..e6a1738 --- /dev/null +++ b/local_repo/python_version_repo/WORKSPACE @@ -0,0 +1,2 @@ +# DO NOT EDIT: automatically generated WORKSPACE file for python_repository rule +workspace(name = "python_version_repo") diff --git a/local_repo/python_version_repo/py_version.bzl b/local_repo/python_version_repo/py_version.bzl new file mode 100755 index 0000000..cb93878 --- /dev/null +++ b/local_repo/python_version_repo/py_version.bzl @@ -0,0 +1,6 @@ + +TF_PYTHON_VERSION = "3.12" +HERMETIC_PYTHON_VERSION = "3.12" +WHEEL_NAME = "tensorflow" +WHEEL_COLLAB = "False" +USE_PYWRAP_RULES = "1" diff --git a/makefile_build/Makefile b/makefile_build/Makefile index ef7d290..fc1893a 100644 --- a/makefile_build/Makefile +++ b/makefile_build/Makefile @@ -22,7 +22,7 @@ LIBEDGETPU_CFLAGS := \ LIBEDGETPU_CXXFLAGS := \ -fPIC \ -Wall \ - -std=c++14 \ + -std=c++17 \ -DDARWINN_PORT_DEFAULT LIBEDGETPU_LDFLAGS := \ @@ -59,7 +59,7 @@ LIBEDGETPU_INCLUDES := \ $(BUILDDIR)/$(BUILDROOT) LIBEDGETPU_INCLUDES := $(addprefix -I,$(LIBEDGETPU_INCLUDES)) -LIBEDGETPU_CSRCS := $(TFROOT)/tensorflow/lite/c/common.c +LIBEDGETPU_CSRCS := $(TFROOT)/tensorflow/lite/c/common_internal.cc LIBEDGETPU_COBJS := $(call TOBUILDDIR,$(patsubst %.c,%.o,$(LIBEDGETPU_CSRCS))) LIBEDGETPU_CCSRCS := \ @@ -140,7 +140,9 @@ LIBEDGETPU_CCSRCS := \ $(BUILDROOT)/tflite/edgetpu_c.cc \ $(BUILDROOT)/tflite/edgetpu_delegate_for_custom_op.cc \ $(BUILDROOT)/tflite/edgetpu_delegate_for_custom_op_tflite_plugin.cc \ - $(TFROOT)/tensorflow/lite/util.cc + $(TFROOT)/tensorflow/lite/core/c/common.cc \ + $(TFROOT)/tensorflow/lite/util.cc \ + $(TFROOT)/tensorflow/lite/array.cc LIBEDGETPU_CCOBJS := $(call TOBUILDDIR,$(patsubst %.cc,%.o,$(LIBEDGETPU_CCSRCS))) # In order to support direct and throttled mode - we need to compile two files @@ -180,12 +182,6 @@ firmware: done @echo "} // namespace" >> $(LIBEDGETPU_FW_OUTPUT) - -$(LIBEDGETPU_COBJS) : $(BUILDDIR)/%.o: %.c - @$(MKDIR) - @echo "Compiling $<" - @$(CC) $(LIBEDGETPU_CFLAGS) $(LIBEDGETPU_INCLUDES) -c $< -MD -MT $@ -MF $(@:%o=%d) -o $@ - $(LIBEDGETPU_CCOBJS) : $(BUILDDIR)/%.o: %.cc @$(MKDIR) @echo "Compiling $<" @@ -201,14 +197,14 @@ $(LIBEDGETPU_STD_CCOBJS) : $(BUILDDIR)/%-throttled.o: %.cc @echo "Compiling $<" @$(CXX) -DTHROTTLE_EDGE_TPU $(LIBEDGETPU_CXXFLAGS) $(LIBEDGETPU_INCLUDES) -c $< -MD -MT $@ -MF $(@:%o=%d) -o $@ -libedgetpu: | firmware $(LIBEDGETPU_FLATC_OBJS) $(LIBEDGETPU_COBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_MAX_CCOBJS) +libedgetpu: | firmware $(LIBEDGETPU_FLATC_OBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_MAX_CCOBJS) @mkdir -p $(BUILDDIR)/direct/k8 @echo "Building libedgetpu.so" - @$(CXX) $(LIBEDGETPU_CCFLAGS) $(LIBEDGETPU_LDFLAGS) $(LIBEDGETPU_COBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_MAX_CCOBJS) -o $(BUILDDIR)/direct/k8/libedgetpu.so.1.0 + @$(CXX) $(LIBEDGETPU_CCFLAGS) $(LIBEDGETPU_LDFLAGS) ${LDFLAGS} $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_MAX_CCOBJS) -o $(BUILDDIR)/direct/k8/libedgetpu.so.1.0 @ln -sf $(BUILDDIR)/direct/k8/libedgetpu.so.1.0 $(BUILDDIR)/direct/k8/libedgetpu.so.1 -libedgetpu-throttled: | firmware $(LIBEDGETPU_FLATC_OBJS) $(LIBEDGETPU_COBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_STD_CCOBJS) +libedgetpu-throttled: | firmware $(LIBEDGETPU_FLATC_OBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_STD_CCOBJS) @mkdir -p $(BUILDDIR)/throttled/k8 @echo "Building throttled libedgetpu.so" - @$(CXX) $(LIBEDGETPU_CCFLAGS) $(LIBEDGETPU_LDFLAGS) $(LIBEDGETPU_COBJS) $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_STD_CCOBJS) -o $(BUILDDIR)/throttled/k8/libedgetpu.so.1.0 + @$(CXX) $(LIBEDGETPU_CCFLAGS) $(LIBEDGETPU_LDFLAGS) ${LDFLAGS} $(LIBEDGETPU_CCOBJS) $(LIBEDGETPU_STD_CCOBJS) -o $(BUILDDIR)/throttled/k8/libedgetpu.so.1.0 @ln -sf $(BUILDDIR)/throttled/k8/libedgetpu.so.1.0 $(BUILDDIR)/throttled/k8/libedgetpu.so.1 diff --git a/makefile_build/README.md b/makefile_build/README.md index a0ed003..8bcfea9 100644 --- a/makefile_build/README.md +++ b/makefile_build/README.md @@ -2,18 +2,40 @@ If only building for native systems, it is possible to significantly reduce the complexity of the build by removing Bazel (and Docker). This simple approach builds only what is needed, removes build-time depenency fetching, increases the speed, and uses upstream Debian packages. -To prepare your system, you'll need the following packages (both available on Debian Bullseye): +To prepare your system, you'll need the following packages (both available on Debian Bookworm / Ubuntu 22.04): ``` -sudo apt install libabsl-dev libflatbuffers-dev +sudo apt install libabsl-dev libusb-1.0-0-dev xxd ``` -Next, you'll need to clone the [Tensorflow Repo](https://github.com/tensorflow/tensorflow) at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF2.5, we can check that [tag in the TF Repo](https://github.com/tensorflow/tensorflow/commit/a4dfb8d1a71385bd6d122e4f27f86dcebb96712d) and then checkout that address: +Next, build [FlatBuffers](https://github.com/google/flatbuffers) from source. This is because the version of Flatbuffers provided in the package is different from the version required by TensorFlow v2.16.1. + +``` +git clone https://github.com/google/flatbuffers.git +cd flatbuffers/ +git checkout v23.5.26 +mkdir build && cd build +cmake .. \ + -DFLATBUFFERS_BUILD_SHAREDLIB=ON \ + -DFLATBUFFERS_BUILD_TESTS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local +make -j$(nproc) +sudo make install +``` + +Next, you'll need to clone the [Tensorflow Repo](https://github.com/tensorflow/tensorflow) at the desired checkout (using TF head isn't advised). If you are planning to use libcoral or pycoral libraries, this should match the ones in those repos' WORKSPACE files. For example, if you are using TF2.16.1, we can check that [tag in the TF Repo](https://github.com/tensorflow/tensorflow/tree/v2.16.1) and then checkout that address: + ``` git clone https://github.com/tensorflow/tensorflow -git checkout a4dfb8d1a71385bd6d122e4f27f86dcebb96712d -b tf2.5 +cd tensorflow +git checkout v2.17.0 ``` To build the library: +Note: The `LDFLAGS` flag is required if you specify flatbuffers to be installed to `"/usr/local"`. + ``` -TFROOT= make -j$(nproc) libedgetpu +git clone https://github.com/google-coral/libedgetpu.git +cd libedgetpu/makefile_build +TFROOT=/home/pi/tensorflow/ LDFLAGS="-L/usr/local/lib" make -j$(nproc) libedgetpu ``` diff --git a/patches/BUILD.bazel b/patches/BUILD.bazel new file mode 100644 index 0000000..e69de29 diff --git a/patches/add_configure_cuda.diff b/patches/add_configure_cuda.diff new file mode 100644 index 0000000..1faef8c --- /dev/null +++ b/patches/add_configure_cuda.diff @@ -0,0 +1,19 @@ +diff -Nru org_tensorflow.orig/tensorflow/workspace2.bzl org_tensorflow/tensorflow/workspace2.bzl +--- org_tensorflow.orig/tensorflow/workspace2.bzl 2025-09-17 13:39:35 ++++ org_tensorflow/tensorflow/workspace2.bzl 2025-09-17 13:40:35 +@@ -29,6 +29,7 @@ + load("//third_party/FP16:workspace.bzl", FP16 = "repo") + load("//third_party/gemmlowp:workspace.bzl", gemmlowp = "repo") + load("//third_party/git:git_configure.bzl", "git_configure") ++load("//third_party/gpus:cuda_configure.bzl", "cuda_configure") + load("//third_party/gpus:rocm_configure.bzl", "rocm_configure") + load("//third_party/gpus:sycl_configure.bzl", "sycl_configure") + load("//third_party/hexagon:workspace.bzl", hexagon_nn = "repo") +@@ -104,6 +105,7 @@ + # Note that we check the minimum bazel version in WORKSPACE. + clang6_configure(name = "local_config_clang6") + cc_download_clang_toolchain(name = "local_config_download_clang") ++ cuda_configure(name = "local_config_cuda") + tensorrt_configure(name = "local_config_tensorrt") + git_configure(name = "local_config_git") + syslibs_configure(name = "local_config_syslibs") diff --git a/workspace.bzl b/workspace.bzl index 979e44d..66f6a25 100644 --- a/workspace.bzl +++ b/workspace.bzl @@ -46,8 +46,36 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") #TENSORFLOW_SHA256 = "bb25fa4574e42ea4d452979e1d2ba3b86b39569d6b8106a846a238b880d73652" # TF release 2.16.1 as of 03/07/2024. Current. -TENSORFLOW_COMMIT = "5bc9d26649cca274750ad3625bd93422617eed4b" -TENSORFLOW_SHA256 = "fe592915c85d1a89c20f3dd89db0772ee22a0fbda78e39aa46a778d638a96abc" +#TENSORFLOW_COMMIT = "5bc9d26649cca274750ad3625bd93422617eed4b" +#TENSORFLOW_SHA256 = "fe592915c85d1a89c20f3dd89db0772ee22a0fbda78e39aa46a778d638a96abc" + +# TF release 2.17.0 as of 07/12/2024. +#TENSORFLOW_COMMIT = "ad6d8cc177d0c868982e39e0823d0efbfb95f04c" +#TENSORFLOW_SHA256 = "75b8dc9b33afff6f2e2d2e2dacc26dd0973bdcee94eec2af290828c1bc574bdc" + +# TF release 2.17.1 as of 10/24/2024. +#TENSORFLOW_COMMIT = "3c92ac03cab816044f7b18a86eb86aa01a294d95" +#TENSORFLOW_SHA256 = "317dd95c4830a408b14f3e802698eb68d70d81c7c7cfcd3d28b0ba023fe84a68" + +# TF release 2.18.0 as of 10/24/2024. +#TENSORFLOW_COMMIT = "6550e4bd80223cdb8be6c3afd1f81e86a4d433c3" +#TENSORFLOW_SHA256 = "403916fbcfcbd5657cd891a871debc72433d7a8c56760297a79085e1abc8f18a" + +# TF release 2.18.1 as of 03/07/2025. +#TENSORFLOW_COMMIT = "cb64295ec7308f770b22db6047a1e755b35b7bee" +#TENSORFLOW_SHA256 = "5fcca4ec0732e146547fc26f6966cf92236c2f85a9e086b85c83d303e2c38980" + +# TF release 2.19.0 as of 03/05/2025. +#TENSORFLOW_COMMIT = "e36baa302922ea3c7131b302c2996bd2051ee5c4" +#TENSORFLOW_SHA256 = "49279646fe4effe3bdc8f5227724566991adc70cf2fd2d22e5591c397db9b037" + +# TF release 2.19.1 as of 08/11/2025. +TENSORFLOW_COMMIT = "f4247ebb6f9e7421f38c3f01a9a5d5cd54bd24fd" +TENSORFLOW_SHA256 = "b4cbd03710db2f05a0f4f5f238c496f39e6be34bab1a168e5c0ade1b23d74dfe" + +# TF release 2.20.0 as of 08/06/2025. +#TENSORFLOW_COMMIT = "72fbba3d20f4616d7312b5e2b7f79daf6e82f2fa" +#TENSORFLOW_SHA256 = "86150d55ce57b2298d8ed42caa7b91c466ad33d9f7f347117c2257cc576d3413" #CORAL_CROSSTOOL_COMMIT = "6bcc2261d9fc60dff386b557428d98917f0af491" #CORAL_CROSSTOOL_SHA256 = "38cb4da13009d07ebc2fed4a9d055b0f914191b344dd2d1ca5803096343958b4" @@ -77,6 +105,8 @@ def libedgetpu_dependencies( ], sha256 = tensorflow_sha256, strip_prefix = "tensorflow-" + tensorflow_commit, + patches = ["//patches:add_configure_cuda.diff"], + patch_args = ["-p1"], ) maybe(