unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andy Tai <atai@atai.org>
To: 65835@debbugs.gnu.org
Cc: Andy Tai <atai@atai.org>
Subject: [bug#65835] [PATCH] gnu: tensorflow-lite: Update to 2.13.0
Date: Sat,  9 Sep 2023 00:44:48 -0700	[thread overview]
Message-ID: <f83e865f181992af66fc489cf659dcc042a39e5d.1694245434.git.atai@atai.org> (raw)

* 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

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





             reply	other threads:[~2023-09-09  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-09  7:44 Andy Tai [this message]
2023-09-10  7:23 ` [bug#65835] [PATCH v2] gnu: tensorflow-lite: Update to 2.13.0 Andy Tai
2023-09-14 21:42   ` [bug#65835] [PATCH] " Ludovic Courtès
2023-09-14 21:49     ` Andy Tai
2023-09-15  5:20 ` [bug#65835] [PATCH v2] " Andy Tai
2023-09-18 21:29   ` bug#65835: [PATCH] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f83e865f181992af66fc489cf659dcc042a39e5d.1694245434.git.atai@atai.org \
    --to=atai@atai.org \
    --cc=65835@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).