mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Revert "[BE] Make Eigen an optional dependency (#155955)"
This reverts commit 1b50c12584.
Reverted https://github.com/pytorch/pytorch/pull/155955 on behalf of https://github.com/atalman due to need to revert eigen test ([comment](https://github.com/pytorch/pytorch/pull/155955#issuecomment-2992512124))
This commit is contained in:
parent
d309cd1d50
commit
208ec60e72
4
.gitmodules
vendored
4
.gitmodules
vendored
|
|
@ -2,6 +2,10 @@
|
|||
ignore = dirty
|
||||
path = third_party/pybind11
|
||||
url = https://github.com/pybind/pybind11.git
|
||||
[submodule "third_party/eigen"]
|
||||
ignore = dirty
|
||||
path = third_party/eigen
|
||||
url = https://gitlab.com/libeigen/eigen.git
|
||||
[submodule "third_party/googletest"]
|
||||
ignore = dirty
|
||||
path = third_party/googletest
|
||||
|
|
|
|||
|
|
@ -778,6 +778,25 @@ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
|
|||
endif()
|
||||
list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
|
||||
|
||||
# ---[ EIGEN
|
||||
# Due to license considerations, we will only use the MPL2 parts of Eigen.
|
||||
set(EIGEN_MPL2_ONLY 1)
|
||||
if(USE_SYSTEM_EIGEN_INSTALL)
|
||||
find_package(Eigen3)
|
||||
if(EIGEN3_FOUND)
|
||||
message(STATUS "Found system Eigen at " ${EIGEN3_INCLUDE_DIR})
|
||||
else()
|
||||
message(STATUS "Did not find system Eigen. Using third party subdirectory.")
|
||||
set(EIGEN3_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/eigen)
|
||||
caffe2_update_option(USE_SYSTEM_EIGEN_INSTALL OFF)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using third party subdirectory Eigen.")
|
||||
set(EIGEN3_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/eigen)
|
||||
endif()
|
||||
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
|
||||
|
||||
|
||||
# ---[ Python Interpreter
|
||||
# If not given a Python installation, then use the current active Python
|
||||
if(NOT Python_EXECUTABLE)
|
||||
|
|
@ -791,29 +810,6 @@ if(NOT Python_EXECUTABLE)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# ---[ EIGEN
|
||||
# Due to license considerations, we will only use the MPL2 parts of Eigen.
|
||||
set(EIGEN_MPL2_ONLY 1)
|
||||
if(USE_SYSTEM_EIGEN_INSTALL)
|
||||
find_package(Eigen3)
|
||||
if(EIGEN3_FOUND)
|
||||
message(STATUS "Found system Eigen at " ${EIGEN3_INCLUDE_DIR})
|
||||
else()
|
||||
message(STATUS "Did not find system Eigen. Using third party subdirectory.")
|
||||
execute_process(COMMAND ${Python_EXECUTABLE} ../tools/optional_modules.py checkout_eigen
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
set(EIGEN3_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/eigen)
|
||||
caffe2_update_option(USE_SYSTEM_EIGEN_INSTALL OFF)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using third party subdirectory Eigen.")
|
||||
set(EIGEN3_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../third_party/eigen)
|
||||
endif()
|
||||
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
|
||||
|
||||
|
||||
if(BUILD_PYTHON)
|
||||
set(PYTHON_COMPONENTS Development.Module)
|
||||
if(USE_NUMPY)
|
||||
|
|
|
|||
1
third_party/eigen
vendored
Submodule
1
third_party/eigen
vendored
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 3147391d946bb4b6c68edd901f2add6ac1f31f8c
|
||||
1
third_party/eigen_pin.txt
vendored
1
third_party/eigen_pin.txt
vendored
|
|
@ -1 +0,0 @@
|
|||
3.4.0
|
||||
|
|
@ -43,21 +43,5 @@ def checkout_nccl() -> None:
|
|||
_checkout_by_tag("https://github.com/NVIDIA/nccl", release_tag)
|
||||
|
||||
|
||||
def checkout_eigen() -> None:
|
||||
eigen_tag = _read_file(third_party_path / "eigen_pin.txt")
|
||||
print(f"-- Checkout Eigen release tag: {eigen_tag}")
|
||||
eigen_basedir = third_party_path / "eigen"
|
||||
if not eigen_basedir.exists():
|
||||
_checkout_by_tag("https://gitlab.com/libeigen/eigen", eigen_tag)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
# If no arguments are given checkout all optional dependency
|
||||
checkout_nccl()
|
||||
checkout_eigen()
|
||||
else:
|
||||
# Otherwise just call top-level function of choice
|
||||
globals()[sys.argv[1]]()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user