Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
7e5874c2
Unverified
Commit
7e5874c2
authored
4 years ago
by
Adam J. Stewart
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
PyTorch: add patches to fix build (#16477)
parent
fbdd2908
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
var/spack/repos/builtin/packages/py-torch/package.py
+11
-3
11 additions, 3 deletions
var/spack/repos/builtin/packages/py-torch/package.py
var/spack/repos/builtin/packages/py-torch/xnnpack.patch
+47
-0
47 additions, 0 deletions
var/spack/repos/builtin/packages/py-torch/xnnpack.patch
with
58 additions
and
3 deletions
var/spack/repos/builtin/packages/py-torch/package.py
+
11
−
3
View file @
7e5874c2
...
@@ -107,9 +107,6 @@ class PyTorch(PythonPackage, CudaPackage):
...
@@ -107,9 +107,6 @@ class PyTorch(PythonPackage, CudaPackage):
conflicts
(
'
+tbb
'
,
when
=
'
@:1.1
'
)
conflicts
(
'
+tbb
'
,
when
=
'
@:1.1
'
)
# https://github.com/pytorch/pytorch/issues/35149
# https://github.com/pytorch/pytorch/issues/35149
conflicts
(
'
+fbgemm
'
,
when
=
'
@1.4.0
'
)
conflicts
(
'
+fbgemm
'
,
when
=
'
@1.4.0
'
)
# https://github.com/pytorch/pytorch/issues/35478
conflicts
(
'
%clang@11.0.3-apple
'
,
msg
=
'
Apple Clang 11.0.3 segfaults at build-time
'
)
conflicts
(
'
cuda_arch=none
'
,
when
=
'
+cuda
'
,
conflicts
(
'
cuda_arch=none
'
,
when
=
'
+cuda
'
,
msg
=
'
Must specify CUDA compute capabilities of your GPU, see
'
msg
=
'
Must specify CUDA compute capabilities of your GPU, see
'
...
@@ -170,6 +167,17 @@ class PyTorch(PythonPackage, CudaPackage):
...
@@ -170,6 +167,17 @@ class PyTorch(PythonPackage, CudaPackage):
depends_on
(
'
py-six
'
,
type
=
'
test
'
)
depends_on
(
'
py-six
'
,
type
=
'
test
'
)
depends_on
(
'
py-psutil
'
,
type
=
'
test
'
)
depends_on
(
'
py-psutil
'
,
type
=
'
test
'
)
# https://github.com/pytorch/pytorch/pull/35607
# https://github.com/pytorch/pytorch/pull/37865
# Fixes CMake configuration error when XNNPACK is disabled
patch
(
'
xnnpack.patch
'
,
when
=
'
@1.5.0
'
)
# https://github.com/pytorch/pytorch/pull/37086
# Fixes compilation with Clang 9.0.0 and Apple Clang 11.0.3
patch
(
'
https://github.com/pytorch/pytorch/commit/e921cd222a8fbeabf5a3e74e83e0d8dfb01aa8b5.patch
'
,
sha256
=
'
7781c7ec0a661bf5a946a659f80e90df9dba116ad168762f15b10547113ae600
'
,
when
=
'
@1.1:1.5
'
)
# Both build and install run cmake/make/make install
# Both build and install run cmake/make/make install
# Only run once to speed up build times
# Only run once to speed up build times
phases
=
[
'
install
'
]
phases
=
[
'
install
'
]
...
...
This diff is collapsed.
Click to expand it.
var/spack/repos/builtin/packages/py-torch/xnnpack.patch
0 → 100644
+
47
−
0
View file @
7e5874c2
diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
index 8025a7de3c..0da37079d6 100644
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
@@ -46,12 +46,19 @@
if (INTERN_BUILD_ATEN_OPS)
list(APPEND Caffe2_DEPENDENCY_INCLUDE ${ATen_THIRD_PARTY_INCLUDE})
endif()
+# {Q/X,etc} NPACK support is enabled by default, if none of these options
+# are selected, turn this flag ON to incidate the support is disabled
+set(NNPACK_AND_FAMILY_DISABLED OFF)
+if(NOT (USE_NNPACK OR USE_QNNPACK OR USE_PYTORCH_QNNPACK OR USE_XNNPACK))
+ set(NNPACK_AND_FAMILY_DISABLED ON)
+endif()
+
# ---[ Caffe2 build
# Note: the folders that are being commented out have not been properly
# addressed yet.
# For pthreadpool_new_if_impl. TODO: Remove when threadpools are unitied.
-if (NOT MSVC)
+if (NOT MSVC AND NOT NNPACK_AND_FAMILY_DISABLED)
IF(NOT TARGET fxdiv)
SET(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
SET(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
@@ -710,7 +717,7 @@
ELSEIF(USE_CUDA)
ENDIF()
-if (NOT MSVC)
+if (NOT MSVC AND NOT NNPACK_AND_FAMILY_DISABLED)
TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
endif()
diff --git a/caffe2/utils/CMakeLists.txt b/caffe2/utils/CMakeLists.txt
index 27aabb1315..3c7845c67d 100644
--- a/caffe2/utils/CMakeLists.txt
+++ b/caffe2/utils/CMakeLists.txt
@@ -36,7 +36,7 @@
list(APPEND Caffe2_CPU_SRCS
# ---[ threadpool/pthreadpool* is a local modification of the NNPACK
# pthreadpool with a very similar interface. Neither NNPACK, nor this
# thread pool supports Windows.
-if (NOT MSVC)
+if (NOT MSVC AND NOT NNPACK_AND_FAMILY_DISABLED)
add_definitions(-DUSE_INTERNAL_THREADPOOL_IMPL)
set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS}
utils/threadpool/pthreadpool.cc
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment