[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
19/22: gnu: tensorflow: Enable parallel build (at least partially).
From: |
guix-commits |
Subject: |
19/22: gnu: tensorflow: Enable parallel build (at least partially). |
Date: |
Sun, 10 Oct 2021 00:53:37 -0400 (EDT) |
apteryx pushed a commit to branch staging
in repository guix.
commit b33dc57d3e37ceebd347a35435ef663537b15a8c
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Sat Oct 9 00:19:56 2021 -0400
gnu: tensorflow: Enable parallel build (at least partially).
There are still many parts of the build that happen sequentially, but at
least
this hastens the long build somewhat.
* gnu/packages/machine-learning.scm (tensorflow)[phases]: Remove trailing
#t.
{build-pip-package}: Honor the PARALLEL-BUILD? argument.
---
gnu/packages/machine-learning.scm | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/gnu/packages/machine-learning.scm
b/gnu/packages/machine-learning.scm
index d709120..9a8d1d5 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1745,7 +1745,7 @@ Python.")
((guix build python-build-system)
#:select (python-version)))
#:imported-modules (,@%cmake-build-system-modules
- (guix build python-build-system))
+ (guix build python-build-system))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-source-file-times-to-1980
@@ -1775,8 +1775,7 @@ Python.")
;; https://github.com/tensorflow/tensorflow/issues/34197
(substitute* (find-files "tensorflow/python" ".*\\.cc$")
(("(nullptr,)(\\ +/. tp_print)" _ _ tp_print)
- (string-append "NULL, " tp_print)))
- #t))
+ (string-append "NULL, " tp_print)))))
(add-after 'python3.7-compatibility 'chdir
(lambda _ (chdir "tensorflow/contrib/cmake") #t))
(add-after 'chdir 'disable-downloads
@@ -1874,8 +1873,7 @@ set(eigen_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive "
(("tf_core_cpu grpc") "tf_core_cpu"))
;; This directory is a dependency of many targets.
- (mkdir-p "protobuf")
- #t))
+ (mkdir-p "protobuf")))
(add-after 'configure 'unpack-third-party-sources
(lambda* (#:key inputs #:allow-other-keys)
;; This is needed to configure bundled packages properly.
@@ -1915,8 +1913,7 @@ set(eigen_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive "
"re2"))
(rename-file "../build/cub/src/cub/cub-1.8.0/"
- "../build/cub/src/cub/cub/")
- #t))
+ "../build/cub/src/cub/cub/")))
(add-after 'unpack 'fix-python-build
(lambda* (#:key inputs outputs #:allow-other-keys)
(mkdir-p "protobuf-src")
@@ -1955,21 +1952,22 @@ set(eigen_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive "
(string-append "set_target_properties(${_AT_TARGET} PROPERTIES
\
COMPILE_FLAGS ${target_compile_flags} \
INSTALL_RPATH_USE_LINK_PATH TRUE \
-INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n")))
- #t))
+INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n")))))
(add-after 'build 'build-pip-package
- (lambda* (#:key outputs #:allow-other-keys)
+ (lambda* (#:key outputs parallel-build? #:allow-other-keys)
(setenv "LDFLAGS"
(string-append "-Wl,-rpath="
(assoc-ref outputs "out") "/lib"))
- (invoke "make" "tf_python_build_pip_package")
- #t))
+ (invoke "make" "-j" (if parallel-build?
+ (number->string (parallel-job-count))
+ "1")
+ "tf_python_build_pip_package")))
(add-after 'build-pip-package 'install-python
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(wheel (car (find-files "../build/tf_python/dist/"
"\\.whl$")))
(python-version (python-version
- (assoc-ref inputs "python"))))
+ (assoc-ref inputs "python"))))
(invoke "python" "-m" "pip" "install" wheel
(string-append "--prefix=" out))
@@ -1978,8 +1976,7 @@ INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n")))
(string-append
out "/lib/python" python-version
"/site-packages/tensorflow/contrib/"
- "seq2seq/python/ops/lib_beam_search_ops.so"))
- #t))))))
+ "seq2seq/python/ops/lib_beam_search_ops.so"))))))))
(native-inputs
`(("pkg-config" ,pkg-config)
("protobuf:native" ,protobuf-3.6) ; protoc
- 04/22: gnu: abseil-cpp: Remove googletest patch., (continued)
- 04/22: gnu: abseil-cpp: Remove googletest patch., guix-commits, 2021/10/10
- 06/22: gnu: mozjs-78: Update to 78.13.0., guix-commits, 2021/10/10
- 07/22: gnu: Add a missing copyright., guix-commits, 2021/10/10
- 08/22: gnu: polkit: Update to 0.120 and ungraft., guix-commits, 2021/10/10
- 15/22: gnu: gst-libav: Update to 1.18.5., guix-commits, 2021/10/10
- 11/22: gnu: gst-plugins-base: Update to 1.18.5., guix-commits, 2021/10/10
- 09/22: Revert gstreamer update to 1.19.2., guix-commits, 2021/10/10
- 16/22: gnu: gst-editing-services: Update to 1.18.5., guix-commits, 2021/10/10
- 17/22: gnu: python-gst: Update to 1.18.5., guix-commits, 2021/10/10
- 14/22: gnu: gst-plugins-ugly: Update to 1.18.5., guix-commits, 2021/10/10
- 19/22: gnu: tensorflow: Enable parallel build (at least partially).,
guix-commits <=
- 10/22: gnu: gstreamer: Update to 1.18.5., guix-commits, 2021/10/10
- 05/22: gnu: abseil-cpp: Update to 20210324.2., guix-commits, 2021/10/10
- 13/22: gnu: gst-plugins-bad: Update to 1.18.5., guix-commits, 2021/10/10
- 22/22: gnu: libnice: Update to 0.1.18-0.47a9633., guix-commits, 2021/10/10
- 21/22: gnu: dbus-c++: Fix build., guix-commits, 2021/10/10
- 12/22: gnu: gst-plugins-good: Update to 1.18.5., guix-commits, 2021/10/10
- 18/22: gnu: gstreamer-docs: Update to 1.18.5., guix-commits, 2021/10/10
- 20/22: gnu: python-keras: Enable parallel tests., guix-commits, 2021/10/10