Make build work (LTC not adapted yet).

breakup_python_pytorch_deps
Stella Laurenzo 2023-11-18 16:44:49 -08:00
parent e7ead186cb
commit 61f5ff2ee4
5 changed files with 5 additions and 30 deletions

View File

@ -149,10 +149,12 @@ endfunction()
# Configure CMake. # Configure CMake.
list(APPEND CMAKE_MODULE_PATH ${MLIR_MAIN_SRC_DIR}/cmake/modules) list(APPEND CMAKE_MODULE_PATH ${MLIR_MAIN_SRC_DIR}/cmake/modules)
list(APPEND CMAKE_MODULE_PATH ${LLVM_MAIN_SRC_DIR}/cmake) list(APPEND CMAKE_MODULE_PATH ${LLVM_MAIN_SRC_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/cmake)
include(TableGen) include(TableGen)
include(AddLLVM) include(AddLLVM)
include(AddMLIR) include(AddMLIR)
include(AddMLIRPython)
################################################################################ ################################################################################
# Setup python. # Setup python.

View File

@ -2,7 +2,7 @@ include(AddMLIRPython)
# Configure PyTorch if we have any features enabled which require it. # Configure PyTorch if we have any features enabled which require it.
if(TORCH_MLIR_ENABLE_JIT_IR_IMPORTER OR TORCH_MLIR_ENABLE_LTC) if(TORCH_MLIR_ENABLE_JIT_IR_IMPORTER OR TORCH_MLIR_ENABLE_LTC)
message("Enabling PyTorch C++ dep (features depend on it)") message(STATUS "Enabling PyTorch C++ dep (features depend on it)")
include(TorchMLIRPyTorch) include(TorchMLIRPyTorch)
TorchMLIRProbeForPyTorchInstall() TorchMLIRProbeForPyTorchInstall()
@ -39,5 +39,5 @@ endif()
# Include overall PT1 project. # Include overall PT1 project.
if(TORCH_MLIR_ENABLE_PROJECT_PT1) if(TORCH_MLIR_ENABLE_PROJECT_PT1)
add_subdirectory(projects/pt1) add_subdirectory(pt1)
endif() endif()

View File

@ -1,28 +1,3 @@
###########################################################################
# Setup PyTorch
###########################################################################
include(TorchMLIRPyTorch)
TorchMLIRProbeForPyTorchInstall()
if(TORCH_MLIR_USE_INSTALLED_PYTORCH)
TorchMLIRConfigurePyTorch()
else()
# Assume it is a sibling to the overall project.
set(Torch_DIR "${PROJECT_SOURCE_DIR}/../libtorch/share/cmake/Torch")
message(STATUS "Attempting to locate libtorch as a sibling to the project: ${Torch_DIR}")
endif()
find_package(Torch 1.11 REQUIRED)
###########################################################################
# Setup Python development
###########################################################################
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/externals/llvm-project/mlir/cmake/modules")
include(MLIRDetectPythonEnv)
mlir_configure_python_dev_packages()
########################################################################### ###########################################################################
# Library definition # Library definition
########################################################################### ###########################################################################

View File

@ -12,7 +12,6 @@ target_link_libraries(TorchMLIRJITIRImporter
TorchMLIRAggregateCAPI TorchMLIRAggregateCAPI
${TORCH_LIBRARIES} ${TORCH_LIBRARIES}
) )
message(STATUS "TORCH_CXXFLAGS=${TORCH_CXXFLAGS}")
set_target_properties(TorchMLIRJITIRImporter PROPERTIES set_target_properties(TorchMLIRJITIRImporter PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/_mlir_libs" LIBRARY_OUTPUT_DIRECTORY "${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/_mlir_libs"
OUTPUT_NAME lib_jit_ir_importer OUTPUT_NAME lib_jit_ir_importer
@ -50,7 +49,6 @@ if(Python3_LIBRARIES)
) )
endif() endif()
message(STATUS "TORCH_CXXFLAGS=${TORCH_CXXFLAGS}")
set_target_properties(TorchMLIRJITIRImporterPybind PROPERTIES set_target_properties(TorchMLIRJITIRImporterPybind PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/_mlir_libs" LIBRARY_OUTPUT_DIRECTORY "${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/_mlir_libs"
OUTPUT_NAME _jit_ir_importer OUTPUT_NAME _jit_ir_importer

View File

@ -23,4 +23,4 @@ add_lit_testsuite(check-torch-mlir-pt1 "Running the torch-mlir PT1 regression te
) )
set_target_properties(check-torch-mlir-pt1 PROPERTIES FOLDER "Tests") set_target_properties(check-torch-mlir-pt1 PROPERTIES FOLDER "Tests")
add_lit_testsuites(TORCH_MLIR ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TORCH_MLIR_TEST_DEPENDS}) add_lit_testsuites(TORCH_MLIR_PT1 ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TORCH_MLIR_TEST_DEPENDS})