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