[PATCH] gnu: tensorflow-lite: Update to 2.13.0

  • Done
  • quality assurance status badge
Details
2 participants
  • Andy Tai
  • Ludovic Courtès
Owner
unassigned
Submitted by
Andy Tai
Severity
normal

Debbugs page

Andy Tai wrote 2 years ago
(address . guix-patches@gnu.org)(name . Andy Tai)(address . atai@atai.org)
f83e865f181992af66fc489cf659dcc042a39e5d.1694245434.git.atai@atai.org
* gnu/packages/machine-learning.scm: (tensorflow-lite):
Update to 2.13.0
[inputs]: Add gemmlowp
[native-inputs]: Remove gemmlowp-src
* gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch:
New file
---
gnu/packages/machine-learning.scm | 48 +++++++++++--------
...able-local-cmake-3rdparty-components.patch | 26 ++++++++++
2 files changed, 55 insertions(+), 19 deletions(-)
create mode 100644 gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch

Toggle diff (137 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index fd0be8d500..e07e0e542a 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -2972,7 +2972,7 @@ (define-public tensorflow
(define-public tensorflow-lite
(package
(name "tensorflow-lite")
- (version "2.12.1")
+ (version "2.13.0")
(source
(origin
(method git-fetch)
@@ -2982,7 +2982,12 @@ (define-public tensorflow-lite
(file-name (git-file-name name version))
(sha256
(base32
- "0jkgljdagdqllnxygl35r5bh3f9qmbczymfj357gm9krh59g2kmd"))))
+ "07g6vlrs0aayrg2mfdl15gxg5dy103wx2xlqkran15dib40nkbj6"))
+ (patches
+ (search-patches
+ ;; patch to disable local cmake build code for 3rdparty
+ ;; componentas
+ "tensorflow-lite-disable-local-cmake-3rdparty-components.patch"))))
(build-system cmake-build-system)
(arguments
(list
@@ -3025,6 +3030,7 @@ (define-public tensorflow-lite
"-DTFLITE_ENABLE_XNNPACK=OFF"
;; Don't fetch the sources. We have these already
+ "-Dgemmlowp_POPULATED=TRUE"
"-Degl_headers_POPULATED=TRUE"
"-Dfp16_headers_POPULATED=TRUE"
"-Dopencl_headers_POPULATED=TRUE"
@@ -3037,7 +3043,9 @@ (define-public tensorflow-lite
"-DFFT2D_SOURCE_DIR=/tmp/fft2d"
"-DFARMHASH_SOURCE_DIR=/tmp/farmhash"
- "-Dgemmlowp_SOURCE_DIR=/tmp/gemmlowp")
+ ;"-Dgemmlowp_SOURCE_DIR=/tmp/gemmlowp"
+ (string-append "-Dgemmlowp_ROOT=" #$(this-package-input "gemmlowp"))
+ )
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'chdir
@@ -3069,8 +3077,10 @@ (define-public tensorflow-lite
(invoke "tar" "--strip-components=1"
"-xf" (assoc-ref inputs "fft2d-src")))
- (copy-recursively (assoc-ref inputs "gemmlowp-src")
- "/tmp/gemmlowp/")))
+ ;(copy-recursively (assoc-ref inputs "gemmlowp-src")
+ ; "/tmp/gemmlowp/")
+
+ ))
(add-after 'build 'build-shared-library
(lambda* (#:key configure-flags #:allow-other-keys)
@@ -3101,7 +3111,7 @@ (define-public tensorflow-lite
("eigen" ,eigen)
("fp16" ,fp16)
("flatbuffers-shared" ,flatbuffers-next-shared)
- ;;("gemmlowp" ,gemmlowp) ; TODO
+ ("gemmlowp" ,gemmlowp)
("mesa-headers" ,mesa-headers)
("neon2sse" ,neon2sse)
("nsync" ,nsync)
@@ -3117,19 +3127,19 @@ (define-public tensorflow-lite
(native-inputs
`(("pkg-config" ,pkg-config)
("googletest" ,googletest)
- ("gemmlowp-src"
- ;; The commit hash is taken from
- ;; "tensorflow/lite/tools/cmake/modules/gemmlowp.cmake".
- ,(let ((commit "fda83bdc38b118cc6b56753bd540caa49e570745"))
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/google/gemmlowp")
- (commit commit)))
- (file-name (git-file-name "gemmlowp" (string-take commit 8)))
- (sha256
- (base32
- "1sbp8kmr2azwlvfbzryy1frxi99jhsh1nc93bdbxdf8zdgpv0kxl")))))
+ ;("gemmlowp-src"
+ ; ;; The commit hash is taken from
+ ; ;; "tensorflow/lite/tools/cmake/modules/gemmlowp.cmake".
+ ; ,(let ((commit "fda83bdc38b118cc6b56753bd540caa49e570745"))
+ ; (origin
+ ; (method git-fetch)
+ ; (uri (git-reference
+ ; (url "https://github.com/google/gemmlowp")
+ ; (commit commit)))
+ ; (file-name (git-file-name "gemmlowp" (string-take commit 8)))
+ ; (sha256
+ ; (base32
+ ; "1sbp8kmr2azwlvfbzryy1frxi99jhsh1nc93bdbxdf8zdgpv0kxl")))))
("farmhash-src"
,(let ((commit "816a4ae622e964763ca0862d9dbd19324a1eaf45"))
(origin
diff --git a/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch b/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch
new file mode 100644
index 0000000000..c94540c3af
--- /dev/null
+++ b/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch
@@ -0,0 +1,26 @@
+diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
+index 0476170e075..90abea00e8c 100644
+--- a/tensorflow/lite/CMakeLists.txt
++++ b/tensorflow/lite/CMakeLists.txt
+@@ -564,7 +564,7 @@ set(_ALL_TFLITE_HDRS ${_ALL_TFLITE_SRCS})
+ list(FILTER _ALL_TFLITE_HDRS INCLUDE REGEX ".*\\.h$")
+ target_include_directories(tensorflow-lite
+ PUBLIC $<BUILD_INTERFACE:${TENSORFLOW_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+- ${CMAKE_BINARY_DIR}/gemmlowp
++ ${gemmlowp_ROOT}/include/gemmlowp
+ )
+ target_link_libraries(tensorflow-lite
+ PUBLIC
+diff --git a/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake b/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
+index 70331ad0a69..a9bd8a0f3bd 100644
+--- a/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
++++ b/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
+@@ -18,7 +18,7 @@
+ include(gemmlowp)
+ if(gemmlowp_POPULATED)
+ set(GEMMLOWP_FOUND TRUE)
+- get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
++ #get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
+ set(GEMMLOWP_LIBRARIES
+ gemmlowp
+ gemmlowp_fixedpoint

base-commit: e2e5df596f5e682d78043b12463cc47d14291ba9
--
2.41.0
Andy Tai wrote 2 years ago
[PATCH v2] gnu: tensorflow-lite: Update to 2.13.0
(address . 65835@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
cdcb2b14ff81a345f8afc1a09d6d0afd5a4b8eb5.1694330587.git.atai@atai.org
* gnu/packages/machine-learning.scm: (tensorflow-lite):
Update to 2.13.0
[inputs]: Add gemmlowp
[native-inputs]: Remove gemmlowp-src
* gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch:
New file
---
gnu/packages/machine-learning.scm | 47 +++++++-------
...able-local-cmake-3rdparty-components.patch | 62 +++++++++++++++++++
2 files changed, 85 insertions(+), 24 deletions(-)
create mode 100644 gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch

Toggle diff (190 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index fd0be8d500..fd6089a525 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -2972,7 +2972,7 @@ (define-public tensorflow
(define-public tensorflow-lite
(package
(name "tensorflow-lite")
- (version "2.12.1")
+ (version "2.13.0")
(source
(origin
(method git-fetch)
@@ -2982,11 +2982,15 @@ (define-public tensorflow-lite
(file-name (git-file-name name version))
(sha256
(base32
- "0jkgljdagdqllnxygl35r5bh3f9qmbczymfj357gm9krh59g2kmd"))))
+ "07g6vlrs0aayrg2mfdl15gxg5dy103wx2xlqkran15dib40nkbj6"))
+ (patches
+ (search-patches
+ ;; patch to disable local cmake build code for 3rdparty
+ ;; componentas
+ "tensorflow-lite-disable-local-cmake-3rdparty-components.patch"))))
(build-system cmake-build-system)
(arguments
(list
- #:tests? #false ;tests are not building now
#:build-type "Release"
#:modules '((ice-9 match)
(guix build utils)
@@ -3005,11 +3009,11 @@ (define-public tensorflow-lite
;; TODO: turn on Farmhash
;;"-DSYSTEM_FARMHASH=ON"
- (string-append "-Dabsl_DIR=" #$(this-package-input "abseil-cpp")
+ (string-append "-Dabseil-cpp_DIR=" #$(this-package-input "abseil-cpp")
"/lib/cmake/absl")
(string-append "-DEigen3_DIR=" #$(this-package-input "eigen")
"/share/eigen3/cmake")
- (string-append "-DFlatBuffers_DIR="
+ (string-append "-Dflatbuffers_DIR="
#$(this-package-input "flatbuffers-shared")
"/lib/cmake/flatbuffers")
(string-append "-DNEON_2_SSE_DIR=" #$(this-package-input "neon2sse")
@@ -3025,6 +3029,9 @@ (define-public tensorflow-lite
"-DTFLITE_ENABLE_XNNPACK=OFF"
;; Don't fetch the sources. We have these already
+ "-Dabseil-cpp_POPULATED=TRUE"
+ "-Dflatbuffers_POPULATED=TRUE"
+ "-Dgemmlowp_POPULATED=TRUE"
"-Degl_headers_POPULATED=TRUE"
"-Dfp16_headers_POPULATED=TRUE"
"-Dopencl_headers_POPULATED=TRUE"
@@ -3037,7 +3044,10 @@ (define-public tensorflow-lite
"-DFFT2D_SOURCE_DIR=/tmp/fft2d"
"-DFARMHASH_SOURCE_DIR=/tmp/farmhash"
- "-Dgemmlowp_SOURCE_DIR=/tmp/gemmlowp")
+ (string-append "-Dabseil-cpp_ROOT=" #$(this-package-input "abseil-cpp"))
+ (string-append "-Dflatbuffers_ROOT=" #$(this-package-input "flatbuffers-shared"))
+ (string-append "-Dgemmlowp_ROOT=" #$(this-package-input "gemmlowp"))
+ )
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'chdir
@@ -3069,8 +3079,10 @@ (define-public tensorflow-lite
(invoke "tar" "--strip-components=1"
"-xf" (assoc-ref inputs "fft2d-src")))
- (copy-recursively (assoc-ref inputs "gemmlowp-src")
- "/tmp/gemmlowp/")))
+ ;(copy-recursively (assoc-ref inputs "gemmlowp-src")
+ ; "/tmp/gemmlowp/")
+
+ ))
(add-after 'build 'build-shared-library
(lambda* (#:key configure-flags #:allow-other-keys)
@@ -3096,12 +3108,12 @@ (define-public tensorflow-lite
(when tests?
(invoke "ctest" "-L" "plain")))))))
(inputs
- `(("abseil-cpp" ,abseil-cpp-20200923.3)
+ `(("abseil-cpp" ,abseil-cpp)
("cpuinfo" ,cpuinfo)
("eigen" ,eigen)
("fp16" ,fp16)
("flatbuffers-shared" ,flatbuffers-next-shared)
- ;;("gemmlowp" ,gemmlowp) ; TODO
+ ("gemmlowp" ,gemmlowp)
("mesa-headers" ,mesa-headers)
("neon2sse" ,neon2sse)
("nsync" ,nsync)
@@ -3117,21 +3129,8 @@ (define-public tensorflow-lite
(native-inputs
`(("pkg-config" ,pkg-config)
("googletest" ,googletest)
- ("gemmlowp-src"
- ;; The commit hash is taken from
- ;; "tensorflow/lite/tools/cmake/modules/gemmlowp.cmake".
- ,(let ((commit "fda83bdc38b118cc6b56753bd540caa49e570745"))
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/google/gemmlowp")
- (commit commit)))
- (file-name (git-file-name "gemmlowp" (string-take commit 8)))
- (sha256
- (base32
- "1sbp8kmr2azwlvfbzryy1frxi99jhsh1nc93bdbxdf8zdgpv0kxl")))))
("farmhash-src"
- ,(let ((commit "816a4ae622e964763ca0862d9dbd19324a1eaf45"))
+ ,(let ((commit "0d859a811870d10f53a594927d0d0b97573ad06d"))
(origin
(method url-fetch)
(uri (string-append
diff --git a/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch b/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch
new file mode 100644
index 0000000000..eb1cc76db6
--- /dev/null
+++ b/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch
@@ -0,0 +1,62 @@
+diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
+index 0476170e075..90abea00e8c 100644
+--- a/tensorflow/lite/CMakeLists.txt
++++ b/tensorflow/lite/CMakeLists.txt
+@@ -564,7 +564,7 @@ set(_ALL_TFLITE_HDRS ${_ALL_TFLITE_SRCS})
+ list(FILTER _ALL_TFLITE_HDRS INCLUDE REGEX ".*\\.h$")
+ target_include_directories(tensorflow-lite
+ PUBLIC $<BUILD_INTERFACE:${TENSORFLOW_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+- ${CMAKE_BINARY_DIR}/gemmlowp
++ ${gemmlowp_ROOT}/include/gemmlowp
+ )
+ target_link_libraries(tensorflow-lite
+ PUBLIC
+diff --git a/tensorflow/lite/kernels/CMakeLists.txt b/tensorflow/lite/kernels/CMakeLists.txt
+index 57ed10d7e64..b45b5d1df82 100644
+--- a/tensorflow/lite/kernels/CMakeLists.txt
++++ b/tensorflow/lite/kernels/CMakeLists.txt
+@@ -25,11 +25,13 @@ set(SCHEMA_GENERATED_PATH ${SCHEMA_GENERATED_ROOT}/tensorflow/lite/schema/mutabl
+ set(SCHEMA_GENERATED_FILE ${SCHEMA_GENERATED_PATH}/schema_generated.h)
+
+ # Use the util function in flatbuffer to generate the schema header.
++list(APPEND CMAKE_MODULE_PATH "${flatbuffers_DIR}")
+ include(BuildFlatBuffers)
+
+ # For cross-compilation purposes a natively compiled 'flatc' compiler is required
+ if(${CMAKE_CROSSCOMPILING})
+ set(FLATC_PATHS
++ ${flatbuffers_ROOT}/bin
+ ${TFLITE_HOST_TOOLS_DIR}
+ ${TFLITE_HOST_TOOLS_DIR}/bin
+ ${TFLITE_HOST_TOOLS_DIR}/flatbuffers-flatc/bin
+@@ -43,7 +45,7 @@ if(${CMAKE_CROSSCOMPILING})
+ set(FLATBUFFERS_FLATC_EXECUTABLE ${FLATC_BIN})
+ endif()
+ else()
+- set(FLATBUFFERS_FLATC_EXECUTABLE ${CMAKE_BINARY_DIR}/flatbuffers-flatc/bin/flatc)
++ set(FLATBUFFERS_FLATC_EXECUTABLE ${flatbuffers_ROOT}/bin/flatc)
+ endif()
+
+ set(FLATBUFFERS_FLATC_SCHEMA_EXTRA_ARGS
+@@ -55,7 +57,7 @@ build_flatbuffers(
+ "${SCHEMA_FILE}"
+ ""
+ mutable_schema_file
+- flatbuffers-flatc
++ ${FLATBUFFERS_FLATC_EXECUTABLE}
+ "${SCHEMA_GENERATED_PATH}"
+ ""
+ ""
+diff --git a/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake b/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
+index 70331ad0a69..a9bd8a0f3bd 100644
+--- a/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
++++ b/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
+@@ -18,7 +18,7 @@
+ include(gemmlowp)
+ if(gemmlowp_POPULATED)
+ set(GEMMLOWP_FOUND TRUE)
+- get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
++ #get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
+ set(GEMMLOWP_LIBRARIES
+ gemmlowp
+ gemmlowp_fixedpoint

base-commit: 5db78e7c1b06d1b4892bdb3e153b95b21577271e
--
2.41.0
Ludovic Courtès wrote 1 years ago
Re: bug#65835: [PATCH] gnu: tensorflow-lite: Update to 2.13.0
(name . Andy Tai)(address . atai@atai.org)(address . 65835@debbugs.gnu.org)
87ttrw3005.fsf_-_@gnu.org
Hi,

Andy Tai <atai@atai.org> skribis:

Toggle quote (7 lines)
> * gnu/packages/machine-learning.scm: (tensorflow-lite):
> Update to 2.13.0
> [inputs]: Add gemmlowp
> [native-inputs]: Remove gemmlowp-src
> * gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch:
> New file

Overall LGTM. Some comments…

Could you add the patch to ‘gnu/local.mk’?

Toggle quote (6 lines)
> + (patches
> + (search-patches
> + ;; patch to disable local cmake build code for 3rdparty
> + ;; componentas
> + "tensorflow-lite-disable-local-cmake-3rdparty-components.patch"))))

Please add the comment at the top of the patch itself, as reported by
‘guix lint’; also adjust indentation here as in the other files.

Toggle quote (3 lines)
> + (string-append "-Dgemmlowp_ROOT=" #$(this-package-input "gemmlowp"))
> + )

Please move paren to the previous line.

Toggle quote (10 lines)
> (invoke "tar" "--strip-components=1"
> "-xf" (assoc-ref inputs "fft2d-src")))
>
> - (copy-recursively (assoc-ref inputs "gemmlowp-src")
> - "/tmp/gemmlowp/")))
> + ;(copy-recursively (assoc-ref inputs "gemmlowp-src")
> + ; "/tmp/gemmlowp/")
> +
> + ))

Leftover? You can remove these two lines.

Could you send an updated patch?

Thanks in advance,
Ludo’.
Andy Tai wrote 1 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 65835@debbugs.gnu.org)
CAJsg1E_xEm_eNvzGvHYQPG_pQyhpKwF1Dnj9+AN+NjsfgfvjNw@mail.gmail.com
will do.

On Thu, Sep 14, 2023 at 2:42 PM Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (51 lines)
> Hi,
>
> Andy Tai <atai@atai.org> skribis:
>
> > * gnu/packages/machine-learning.scm: (tensorflow-lite):
> > Update to 2.13.0
> > [inputs]: Add gemmlowp
> > [native-inputs]: Remove gemmlowp-src
> > *
> gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch:
> > New file
>
> Overall LGTM. Some comments…
>
> Could you add the patch to ‘gnu/local.mk’?
>
> > + (patches
> > + (search-patches
> > + ;; patch to disable local cmake build code for 3rdparty
> > + ;; componentas
> > +
> "tensorflow-lite-disable-local-cmake-3rdparty-components.patch"))))
>
> Please add the comment at the top of the patch itself, as reported by
> ‘guix lint’; also adjust indentation here as in the other files.
>
> > + (string-append "-Dgemmlowp_ROOT=" #$(this-package-input
> "gemmlowp"))
> > + )
>
> Please move paren to the previous line.
>
> > (invoke "tar" "--strip-components=1"
> > "-xf" (assoc-ref inputs "fft2d-src")))
> >
> > - (copy-recursively (assoc-ref inputs "gemmlowp-src")
> > - "/tmp/gemmlowp/")))
> > + ;(copy-recursively (assoc-ref inputs "gemmlowp-src")
> > + ; "/tmp/gemmlowp/")
> > +
> > + ))
>
> Leftover? You can remove these two lines.
>
> Could you send an updated patch?
>
> Thanks in advance,
> Ludo’.
>


--
Andy Tai, atai@atai.org, Skype: licheng.tai, Line: andy_tai, WeChat:
andytai1010
Year 2023 民國112年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能
Attachment: file
Andy Tai wrote 1 years ago
[PATCH v2] gnu: tensorflow-lite: Update to 2.13.0
(name . Andy Tai)(address . atai@atai.org)
c269bfa138f9de25a35df915aa300dfb5d364f6d.1694755212.git.atai@atai.org
* gnu/packages/machine-learning.scm: (tensorflow-lite):
Update to 2.13.0
[inputs]: Add gemmlowp
[native-inputs]: Remove gemmlowp-src
* gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch:
New file
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/machine-learning.scm | 49 ++++++++++---------
...able-local-cmake-3rdparty-components.patch | 28 +++++++++++
3 files changed, 55 insertions(+), 23 deletions(-)
create mode 100644 gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch

Toggle diff (159 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 8862fbfbb9..0af5e1498b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2002,6 +2002,7 @@ dist_patch_DATA = \
%D%/packages/patches/tcsh-fix-autotest.patch \
%D%/packages/patches/teensy-loader-cli-help.patch \
%D%/packages/patches/tensorflow-c-api-fix.patch \
+ %D%/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch \
%D%/packages/patches/texinfo-headings-single.patch \
%D%/packages/patches/texinfo-5-perl-compat.patch \
%D%/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index fd0be8d500..bd94c9a540 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -2972,7 +2972,7 @@ (define-public tensorflow
(define-public tensorflow-lite
(package
(name "tensorflow-lite")
- (version "2.12.1")
+ (version "2.13.0")
(source
(origin
(method git-fetch)
@@ -2982,7 +2982,12 @@ (define-public tensorflow-lite
(file-name (git-file-name name version))
(sha256
(base32
- "0jkgljdagdqllnxygl35r5bh3f9qmbczymfj357gm9krh59g2kmd"))))
+ "07g6vlrs0aayrg2mfdl15gxg5dy103wx2xlqkran15dib40nkbj6"))
+ (patches
+ (search-patches
+ ;; patch to disable local cmake build code for 3rdparty
+ ;; componentas
+ "tensorflow-lite-disable-local-cmake-3rdparty-components.patch"))))
(build-system cmake-build-system)
(arguments
(list
@@ -3025,6 +3030,7 @@ (define-public tensorflow-lite
"-DTFLITE_ENABLE_XNNPACK=OFF"
;; Don't fetch the sources. We have these already
+ "-Dgemmlowp_POPULATED=TRUE"
"-Degl_headers_POPULATED=TRUE"
"-Dfp16_headers_POPULATED=TRUE"
"-Dopencl_headers_POPULATED=TRUE"
@@ -3037,7 +3043,8 @@ (define-public tensorflow-lite
"-DFFT2D_SOURCE_DIR=/tmp/fft2d"
"-DFARMHASH_SOURCE_DIR=/tmp/farmhash"
- "-Dgemmlowp_SOURCE_DIR=/tmp/gemmlowp")
+ ;"-Dgemmlowp_SOURCE_DIR=/tmp/gemmlowp"
+ (string-append "-Dgemmlowp_ROOT=" #$(this-package-input "gemmlowp")))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'chdir
@@ -3067,11 +3074,7 @@ (define-public tensorflow-lite
(mkdir-p "/tmp/fft2d")
(with-directory-excursion "/tmp/fft2d"
(invoke "tar" "--strip-components=1"
- "-xf" (assoc-ref inputs "fft2d-src")))
-
- (copy-recursively (assoc-ref inputs "gemmlowp-src")
- "/tmp/gemmlowp/")))
-
+ "-xf" (assoc-ref inputs "fft2d-src")))))
(add-after 'build 'build-shared-library
(lambda* (#:key configure-flags #:allow-other-keys)
(mkdir-p "c")
@@ -3101,7 +3104,7 @@ (define-public tensorflow-lite
("eigen" ,eigen)
("fp16" ,fp16)
("flatbuffers-shared" ,flatbuffers-next-shared)
- ;;("gemmlowp" ,gemmlowp) ; TODO
+ ("gemmlowp" ,gemmlowp)
("mesa-headers" ,mesa-headers)
("neon2sse" ,neon2sse)
("nsync" ,nsync)
@@ -3117,19 +3120,19 @@ (define-public tensorflow-lite
(native-inputs
`(("pkg-config" ,pkg-config)
("googletest" ,googletest)
- ("gemmlowp-src"
- ;; The commit hash is taken from
- ;; "tensorflow/lite/tools/cmake/modules/gemmlowp.cmake".
- ,(let ((commit "fda83bdc38b118cc6b56753bd540caa49e570745"))
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/google/gemmlowp")
- (commit commit)))
- (file-name (git-file-name "gemmlowp" (string-take commit 8)))
- (sha256
- (base32
- "1sbp8kmr2azwlvfbzryy1frxi99jhsh1nc93bdbxdf8zdgpv0kxl")))))
+ ;("gemmlowp-src"
+ ; ;; The commit hash is taken from
+ ; ;; "tensorflow/lite/tools/cmake/modules/gemmlowp.cmake".
+ ; ,(let ((commit "fda83bdc38b118cc6b56753bd540caa49e570745"))
+ ; (origin
+ ; (method git-fetch)
+ ; (uri (git-reference
+ ; (url "https://github.com/google/gemmlowp")
+ ; (commit commit)))
+ ; (file-name (git-file-name "gemmlowp" (string-take commit 8)))
+ ; (sha256
+ ; (base32
+ ; "1sbp8kmr2azwlvfbzryy1frxi99jhsh1nc93bdbxdf8zdgpv0kxl")))))
("farmhash-src"
,(let ((commit "816a4ae622e964763ca0862d9dbd19324a1eaf45"))
(origin
@@ -3151,7 +3154,7 @@ (define-public tensorflow-lite
(sha256
(base32
"1jfflzi74fag9z4qmgwvp90aif4dpbr1657izmxlgvf4hy8fk9xd"))))))
- (home-page "https://tensorflow.org")
+ (home-page "https://www.tensorflow.org")
(synopsis "Machine learning framework")
(description
"TensorFlow is a flexible platform for building and training machine
diff --git a/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch b/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch
new file mode 100644
index 0000000000..677a6be8c3
--- /dev/null
+++ b/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch
@@ -0,0 +1,28 @@
+Patch to disable local cmake build code for 3rdparty componentas
+
+diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
+index 0476170e075..90abea00e8c 100644
+--- a/tensorflow/lite/CMakeLists.txt
++++ b/tensorflow/lite/CMakeLists.txt
+@@ -564,7 +564,7 @@ set(_ALL_TFLITE_HDRS ${_ALL_TFLITE_SRCS})
+ list(FILTER _ALL_TFLITE_HDRS INCLUDE REGEX ".*\\.h$")
+ target_include_directories(tensorflow-lite
+ PUBLIC $<BUILD_INTERFACE:${TENSORFLOW_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+- ${CMAKE_BINARY_DIR}/gemmlowp
++ ${gemmlowp_ROOT}/include/gemmlowp
+ )
+ target_link_libraries(tensorflow-lite
+ PUBLIC
+diff --git a/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake b/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
+index 70331ad0a69..a9bd8a0f3bd 100644
+--- a/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
++++ b/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
+@@ -18,7 +18,7 @@
+ include(gemmlowp)
+ if(gemmlowp_POPULATED)
+ set(GEMMLOWP_FOUND TRUE)
+- get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
++ #get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
+ set(GEMMLOWP_LIBRARIES
+ gemmlowp
+ gemmlowp_fixedpoint

base-commit: 0c1aa354048f82023e6d2043bfecc4fd58bc9b58
--
2.41.0
Ludovic Courtès wrote 1 years ago
Re: bug#65835: [PATCH] gnu: tensorflow-lite: Update to 2.13.0
(name . Andy Tai)(address . atai@atai.org)(address . 65835-done@debbugs.gnu.org)
87h6nrgoff.fsf_-_@gnu.org
Hi,

Andy Tai <atai@atai.org> skribis:

Toggle quote (8 lines)
> * gnu/packages/machine-learning.scm: (tensorflow-lite):
> Update to 2.13.0
> [inputs]: Add gemmlowp
> [native-inputs]: Remove gemmlowp-src
> * gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch:
> New file
> * gnu/local.mk (dist_patch_DATA): Add it.

Applied with the changes below: shortening the patch file name (as
reported by ‘guix lint’), fixing typos, removing leftover comments.

Thanks,
Ludo’.
Toggle diff (85 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 85bdc19145..de3cb0332c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2003,7 +2003,7 @@ dist_patch_DATA = \
%D%/packages/patches/tcsh-fix-autotest.patch \
%D%/packages/patches/teensy-loader-cli-help.patch \
%D%/packages/patches/tensorflow-c-api-fix.patch \
- %D%/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch \
+ %D%/packages/patches/tensorflow-lite-unbundle.patch \
%D%/packages/patches/texinfo-headings-single.patch \
%D%/packages/patches/texinfo-5-perl-compat.patch \
%D%/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 23975dadf2..abba41626d 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3008,11 +3008,7 @@ (define-public tensorflow-lite
(sha256
(base32
"07g6vlrs0aayrg2mfdl15gxg5dy103wx2xlqkran15dib40nkbj6"))
- (patches
- (search-patches
- ;; patch to disable local cmake build code for 3rdparty
- ;; componentas
- "tensorflow-lite-disable-local-cmake-3rdparty-components.patch"))))
+ (patches (search-patches "tensorflow-lite-unbundle.patch"))))
(build-system cmake-build-system)
(arguments
(list
@@ -3068,7 +3064,6 @@ (define-public tensorflow-lite
"-DFFT2D_SOURCE_DIR=/tmp/fft2d"
"-DFARMHASH_SOURCE_DIR=/tmp/farmhash"
- ;"-Dgemmlowp_SOURCE_DIR=/tmp/gemmlowp"
(string-append "-Dgemmlowp_ROOT=" #$(this-package-input "gemmlowp")))
#:phases
#~(modify-phases %standard-phases
@@ -3145,19 +3140,6 @@ (define-public tensorflow-lite
(native-inputs
`(("pkg-config" ,pkg-config)
("googletest" ,googletest)
- ;("gemmlowp-src"
- ; ;; The commit hash is taken from
- ; ;; "tensorflow/lite/tools/cmake/modules/gemmlowp.cmake".
- ; ,(let ((commit "fda83bdc38b118cc6b56753bd540caa49e570745"))
- ; (origin
- ; (method git-fetch)
- ; (uri (git-reference
- ; (url "https://github.com/google/gemmlowp")
- ; (commit commit)))
- ; (file-name (git-file-name "gemmlowp" (string-take commit 8)))
- ; (sha256
- ; (base32
- ; "1sbp8kmr2azwlvfbzryy1frxi99jhsh1nc93bdbxdf8zdgpv0kxl")))))
("farmhash-src"
,(let ((commit "816a4ae622e964763ca0862d9dbd19324a1eaf45"))
(origin
diff --git a/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch b/gnu/packages/patches/tensorflow-lite-unbundle.patch
similarity index 86%
rename from gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch
rename to gnu/packages/patches/tensorflow-lite-unbundle.patch
index 677a6be8c3..efd7d5bbc6 100644
--- a/gnu/packages/patches/tensorflow-lite-disable-local-cmake-3rdparty-components.patch
+++ b/gnu/packages/patches/tensorflow-lite-unbundle.patch
@@ -1,4 +1,4 @@
-Patch to disable local cmake build code for 3rdparty componentas
+Disable local CMake build code for bundled 3rdparty components.
diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
index 0476170e075..90abea00e8c 100644
@@ -17,12 +17,11 @@ diff --git a/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake b/tensorflow
index 70331ad0a69..a9bd8a0f3bd 100644
--- a/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
+++ b/tensorflow/lite/tools/cmake/modules/Findgemmlowp.cmake
-@@ -18,7 +18,7 @@
+@@ -18,7 +18,6 @@
include(gemmlowp)
if(gemmlowp_POPULATED)
set(GEMMLOWP_FOUND TRUE)
- get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
-+ #get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
set(GEMMLOWP_LIBRARIES
gemmlowp
gemmlowp_fixedpoint
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 65835@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 65835
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help