gnu: python-pytorch: Unbundle NNPACK.

* gnu/packages/machine-learning.scm (python-pytorch)[source]: Delete
"third_party/NNPACK".
[inputs]: Add NNPACK.
[propagated-inputs]: Remove PYTHON-PEACHPY.
* gnu/packages/patches/python-pytorch-system-libraries.patch: Remove
hunk modifying NNPACK; add hunk to allow the use of our own NNPACK.
This commit is contained in:
Ludovic Courtès 2021-09-24 13:46:02 +02:00 committed by Ludovic Courtès
parent 8df301d467
commit d326dec811
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 25 additions and 17 deletions

View file

@ -2668,7 +2668,7 @@ (define-public python-pytorch
;; needs these. ;; needs these.
;; "FP16" "FXdiv" "gemmlowp" "psimd" ;; "FP16" "FXdiv" "gemmlowp" "psimd"
"gloo" "googletest" "ios-cmake" "gloo" "googletest" "ios-cmake" "NNPACK"
"onnx" "protobuf" "pthreadpool" "onnx" "protobuf" "pthreadpool"
"pybind11" "python-enum" "python-peachpy" "pybind11" "python-enum" "python-peachpy"
"python-six" "tbb" "XNNPACK" "zstd")) "python-six" "tbb" "XNNPACK" "zstd"))
@ -2733,6 +2733,7 @@ (define-public python-pytorch
("googletest" ,googletest) ("googletest" ,googletest)
("googlebenchmark" ,googlebenchmark) ("googlebenchmark" ,googlebenchmark)
("gloo" ,gloo) ("gloo" ,gloo)
("nnpack" ,nnpack)
("openblas" ,openblas) ("openblas" ,openblas)
("openmpi" ,openmpi) ("openmpi" ,openmpi)
("pthreadpool" ,pthreadpool) ("pthreadpool" ,pthreadpool)
@ -2746,7 +2747,6 @@ (define-public python-pytorch
("python-numpy" ,python-numpy) ("python-numpy" ,python-numpy)
("python-pyyaml" ,python-pyyaml) ("python-pyyaml" ,python-pyyaml)
("python-cffi" ,python-cffi) ("python-cffi" ,python-cffi)
("python-peachpy" ,python-peachpy)
("python-typing-extensions" ,python-typing-extensions) ("python-typing-extensions" ,python-typing-extensions)
("python-future" ,python-future) ("python-future" ,python-future)
("python-six" ,python-six) ("python-six" ,python-six)

View file

@ -81,7 +81,7 @@ diff --git a/torch/lib/c10d/test/CMakeLists.txt b/torch/lib/c10d/test/CMakeLists
index b74d4b65f7..fc7c207505 100644 index b74d4b65f7..fc7c207505 100644
--- a/torch/lib/c10d/test/CMakeLists.txt --- a/torch/lib/c10d/test/CMakeLists.txt
+++ b/torch/lib/c10d/test/CMakeLists.txt +++ b/torch/lib/c10d/test/CMakeLists.txt
@@ -16,25 +16,25 @@ function(c10d_add_test test_src) @@ -16,24 +16,24 @@ function(c10d_add_test test_src)
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>) add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
endfunction() endfunction()
@ -114,18 +114,26 @@ index b74d4b65f7..fc7c207505 100644
+ c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main gtest) + c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main gtest)
endif() endif()
endif() endif()
diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
index a41343cbb5..6075bdd0a4 100644
--- a/cmake/External/nnpack.cmake
+++ b/cmake/External/nnpack.cmake
@@ -40,7 +40,7 @@ endif()
# (3) Android, iOS, Linux, macOS - supported
##############################################################################
diff --git a/CMakeLists.txt b/CMakeLists.txt -if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
index 5ecd2df..24feae3 100644 +if(FALSE)
--- a/third_party/NNPACK/CMakeLists.txt message(STATUS "Brace yourself, we are building NNPACK")
+++ b/third_party/NNPACK/CMakeLists.txt set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
@@ -427,8 +427,7 @@ IF(NNPACK_BACKEND STREQUAL "x86-64")
FILE(MAKE_DIRECTORY ${obj_dir}) @@ -114,6 +114,5 @@ endif()
ADD_CUSTOM_COMMAND( # (4) Catch-all: not supported.
OUTPUT ${obj} ##############################################################################
- COMMAND "PYTHONPATH=${PEACHPY_PYTHONPATH}"
- ${PYTHON_EXECUTABLE} -m peachpy.x86_64 -message(WARNING "Unknown platform - I don't know how to build NNPACK. "
+ COMMAND ${PYTHON_EXECUTABLE} -m peachpy.x86_64 - "See cmake/External/nnpack.cmake for details.")
-mabi=sysv -g4 -mimage-format=${PEACHPY_IMAGE_FORMAT} -set(USE_NNPACK OFF)
"-I${PROJECT_SOURCE_DIR}/src" "-I${PROJECT_SOURCE_DIR}/src/x86_64-fma" "-I${FP16_SOURCE_DIR}/include" +set(NNPACK_FOUND TRUE)
-o ${obj} "${PROJECT_SOURCE_DIR}/${src}" +set(USE_NNPACK ON)