From patchwork Fri Sep 15 05:20:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Tai X-Patchwork-Id: 53913 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E295827BBE9; Fri, 15 Sep 2023 06:22:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1E06727BBE2 for ; Fri, 15 Sep 2023 06:22:21 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qh1HB-0006Ac-FL; Fri, 15 Sep 2023 01:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qh1H9-0006AP-Si for guix-patches@gnu.org; Fri, 15 Sep 2023 01:21:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qh1H9-00010l-DI for guix-patches@gnu.org; Fri, 15 Sep 2023 01:21:55 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qh1HF-0003J8-Iy for guix-patches@gnu.org; Fri, 15 Sep 2023 01:22:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65835] [PATCH v2] gnu: tensorflow-lite: Update to 2.13.0 References: In-Reply-To: Resent-From: Andy Tai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 15 Sep 2023 05:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65835 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65835@debbugs.gnu.org, ludo@gnu.org Cc: Andy Tai Received: via spool by 65835-submit@debbugs.gnu.org id=B65835.169475527612633 (code B ref 65835); Fri, 15 Sep 2023 05:22:01 +0000 Received: (at 65835) by debbugs.gnu.org; 15 Sep 2023 05:21:16 +0000 Received: from localhost ([127.0.0.1]:41798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qh1GV-0003Hg-ER for submit@debbugs.gnu.org; Fri, 15 Sep 2023 01:21:15 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:62864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qh1GS-0003HA-BF for 65835@debbugs.gnu.org; Fri, 15 Sep 2023 01:21:14 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-68cbbff84f6so2072608b3a.1 for <65835@debbugs.gnu.org>; Thu, 14 Sep 2023 22:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694755260; x=1695360060; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=hG9cck9mSvBxpZ0rJlSJKrOC+BXK/eYQKlsn/uH+iac=; b=NtiI2xhUM0aayBi552IM6/EMwKULMsJYil8CSoRHBDVr4aBCu+4TqqZmonwp2W/MiU EE1gW/z2f58EitKyR6v66LfX/+uBWENJy50/6Df7FfO+BAEOp0BcMhpoxFcKWTEStRn1 uk8SyvPEQnCBFPBDyX4HbCHcIKo1amoDgfHvmTvOK3ajLSKri+lrR9XLEWdifAPJ4Iav 5IskTVhLIW4l98cTcG7GL/ivifve3WiZelxi2XfRcFCPjc01MKminQ2YOvEuYhSJ9JWQ u92kH50uyQKKLScHmnvFr/gamv4DKo5V5C0FRXLr9lcHbfbfhbaRnpWAsV2nNSQqmZcS loJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694755260; x=1695360060; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hG9cck9mSvBxpZ0rJlSJKrOC+BXK/eYQKlsn/uH+iac=; b=hbcreQQkzZmwLYn5DNPQjSFykOTB5t2BZHUuN0ytzp6GubeTJ8Nn7aKRDFbck8cI4t 2HB3hw1adim48LYsDEYC+FSOMm7qn4SdGQxX2+yHLZaEL8Dx52sUd5FyRPiIzcoah3Ga dXuApeLcilZGHCKjDPOBcyHUJTEqmqSE7yF9t4Y2620sKFFRDi5813UmdXJQrm3Ekont a33mb2doqJKsThPeTftBk9eQxxg62m06pXgb0RnG3fnHjBQ5SAlmhTom1aAP9niHcC0v wYVGgGi2XA3u5MfOHER8WJEiNJvieVQunyEASwaToMVPvUhKfI8AyJg9l0zdfqnc+aqS XN3w== X-Gm-Message-State: AOJu0YwRu7JA2u1k9v4M1KbIrh3teO3h1WwwXEnGQlJ2bqp1f9zfhk19 2TG6ij5em9hTaOaGjxNYtnhZl0syaKggiw== X-Google-Smtp-Source: AGHT+IFubpmqPPYEsDBWQAENyjDag2FhB3c31KqOWJMiZNq5M9Ezj4WHYb5hEehd52wG8aR40z628w== X-Received: by 2002:a17:903:32c4:b0:1bb:c896:1d91 with SMTP id i4-20020a17090332c400b001bbc8961d91mr5382090plr.31.1694755259874; Thu, 14 Sep 2023 22:20:59 -0700 (PDT) Received: from localhost.localdomain ([98.37.226.98]) by smtp.googlemail.com with ESMTPSA id l21-20020a170902d35500b001ab39cd875csm2497965plk.133.2023.09.14.22.20.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 22:20:59 -0700 (PDT) From: Andy Tai Date: Thu, 14 Sep 2023 22:20:55 -0700 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 base-commit: 0c1aa354048f82023e6d2043bfecc4fd58bc9b58 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 $ $ +- ${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