guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/07: gnu: tensorflow-lite: Update to 2.13.0.


From: guix-commits
Subject: 04/07: gnu: tensorflow-lite: Update to 2.13.0.
Date: Mon, 18 Sep 2023 17:43:18 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 429a543d2222b12ffd014e1a8dc072c7ece8ad9e
Author: Andy Tai <atai@atai.org>
AuthorDate: Thu Sep 14 22:20:55 2023 -0700

    gnu: tensorflow-lite: Update to 2.13.0.
    
    * 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-unbundle.patch: New file
    * gnu/local.mk (dist_patch_DATA): Add it.
    
    Co-authored-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/local.mk                                       |  1 +
 gnu/packages/machine-learning.scm                  | 31 ++++++----------------
 .../patches/tensorflow-lite-unbundle.patch         | 27 +++++++++++++++++++
 3 files changed, 36 insertions(+), 23 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 13e7d1af72..de3cb0332c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2003,6 +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-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 f351586214..abba41626d 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -2997,7 +2997,7 @@ advanced research.")
 (define-public tensorflow-lite
   (package
     (name "tensorflow-lite")
-    (version "2.12.1")
+    (version "2.13.0")
     (source
      (origin
        (method git-fetch)
@@ -3007,7 +3007,8 @@ advanced research.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0jkgljdagdqllnxygl35r5bh3f9qmbczymfj357gm9krh59g2kmd"))))
+         "07g6vlrs0aayrg2mfdl15gxg5dy103wx2xlqkran15dib40nkbj6"))
+       (patches (search-patches "tensorflow-lite-unbundle.patch"))))
     (build-system cmake-build-system)
     (arguments
      (list
@@ -3050,6 +3051,7 @@ advanced research.")
          "-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"
@@ -3062,7 +3064,7 @@ advanced research.")
 
          "-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
           (add-after 'unpack 'chdir
@@ -3092,11 +3094,7 @@ advanced research.")
               (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")
@@ -3126,7 +3124,7 @@ advanced research.")
        ("eigen" ,eigen)
        ("fp16" ,fp16)
        ("flatbuffers-shared" ,flatbuffers-next-shared)
-       ;;("gemmlowp" ,gemmlowp)  ; TODO
+       ("gemmlowp" ,gemmlowp)
        ("mesa-headers" ,mesa-headers)
        ("neon2sse" ,neon2sse)
        ("nsync" ,nsync)
@@ -3142,19 +3140,6 @@ advanced research.")
     (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
@@ -3176,7 +3161,7 @@ advanced research.")
            (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-unbundle.patch 
b/gnu/packages/patches/tensorflow-lite-unbundle.patch
new file mode 100644
index 0000000000..efd7d5bbc6
--- /dev/null
+++ b/gnu/packages/patches/tensorflow-lite-unbundle.patch
@@ -0,0 +1,27 @@
+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
+--- 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,6 @@
+ include(gemmlowp)
+ if(gemmlowp_POPULATED)
+   set(GEMMLOWP_FOUND TRUE)
+-  get_target_property(GEMMLOWP_INCLUDE_DIRS gemmlowp INTERFACE_DIRECTORIES)
+   set(GEMMLOWP_LIBRARIES
+     gemmlowp
+     gemmlowp_fixedpoint



reply via email to

[Prev in Thread] Current Thread [Next in Thread]