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:
parent
8df301d467
commit
d326dec811
|
@ -2668,7 +2668,7 @@ (define-public python-pytorch
|
|||
;; needs these.
|
||||
;; "FP16" "FXdiv" "gemmlowp" "psimd"
|
||||
|
||||
"gloo" "googletest" "ios-cmake"
|
||||
"gloo" "googletest" "ios-cmake" "NNPACK"
|
||||
"onnx" "protobuf" "pthreadpool"
|
||||
"pybind11" "python-enum" "python-peachpy"
|
||||
"python-six" "tbb" "XNNPACK" "zstd"))
|
||||
|
@ -2733,6 +2733,7 @@ (define-public python-pytorch
|
|||
("googletest" ,googletest)
|
||||
("googlebenchmark" ,googlebenchmark)
|
||||
("gloo" ,gloo)
|
||||
("nnpack" ,nnpack)
|
||||
("openblas" ,openblas)
|
||||
("openmpi" ,openmpi)
|
||||
("pthreadpool" ,pthreadpool)
|
||||
|
@ -2746,7 +2747,6 @@ (define-public python-pytorch
|
|||
("python-numpy" ,python-numpy)
|
||||
("python-pyyaml" ,python-pyyaml)
|
||||
("python-cffi" ,python-cffi)
|
||||
("python-peachpy" ,python-peachpy)
|
||||
("python-typing-extensions" ,python-typing-extensions)
|
||||
("python-future" ,python-future)
|
||||
("python-six" ,python-six)
|
||||
|
|
|
@ -81,7 +81,7 @@ diff --git a/torch/lib/c10d/test/CMakeLists.txt b/torch/lib/c10d/test/CMakeLists
|
|||
index b74d4b65f7..fc7c207505 100644
|
||||
--- a/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}>)
|
||||
endfunction()
|
||||
|
||||
|
@ -115,17 +115,25 @@ index b74d4b65f7..fc7c207505 100644
|
|||
endif()
|
||||
endif()
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 5ecd2df..24feae3 100644
|
||||
--- a/third_party/NNPACK/CMakeLists.txt
|
||||
+++ b/third_party/NNPACK/CMakeLists.txt
|
||||
@@ -427,8 +427,7 @@ IF(NNPACK_BACKEND STREQUAL "x86-64")
|
||||
FILE(MAKE_DIRECTORY ${obj_dir})
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${obj}
|
||||
- COMMAND "PYTHONPATH=${PEACHPY_PYTHONPATH}"
|
||||
- ${PYTHON_EXECUTABLE} -m peachpy.x86_64
|
||||
+ COMMAND ${PYTHON_EXECUTABLE} -m peachpy.x86_64
|
||||
-mabi=sysv -g4 -mimage-format=${PEACHPY_IMAGE_FORMAT}
|
||||
"-I${PROJECT_SOURCE_DIR}/src" "-I${PROJECT_SOURCE_DIR}/src/x86_64-fma" "-I${FP16_SOURCE_DIR}/include"
|
||||
-o ${obj} "${PROJECT_SOURCE_DIR}/${src}"
|
||||
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
|
||||
##############################################################################
|
||||
|
||||
-if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
+if(FALSE)
|
||||
message(STATUS "Brace yourself, we are building NNPACK")
|
||||
set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
|
||||
|
||||
@@ -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)
|
||||
|
|
Loading…
Reference in a new issue