[PYTHON] Fixed torch ABI issue
This commit is contained in:
committed by
Philippe Tillet
parent
06abc8cb40
commit
cf80ccc798
@@ -34,7 +34,7 @@ if(BUILD_PYTHON_MODULE)
|
|||||||
message(STATUS "Adding Python module")
|
message(STATUS "Adding Python module")
|
||||||
# PyBind11 wrapper source file
|
# PyBind11 wrapper source file
|
||||||
set(PYTHON_SRC bindings.cc launch.cc)
|
set(PYTHON_SRC bindings.cc launch.cc)
|
||||||
set_source_files_properties(launch.cc PROPERTIES COMPILE_FLAGS "-std=c++14 -D_GLIBCXX_USE_CXX11_ABI=0")
|
set_source_files_properties(launch.cc PROPERTIES COMPILE_FLAGS "-std=c++14 -D_GLIBCXX_USE_CXX11_ABI=${TORCH_CXX11_ABI}")
|
||||||
include_directories("." ${PYTHON_INCLUDE_DIRS})
|
include_directories("." ${PYTHON_INCLUDE_DIRS})
|
||||||
link_directories(${PYTHON_LINK_DIRS})
|
link_directories(${PYTHON_LINK_DIRS})
|
||||||
endif()
|
endif()
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
#include <stack>
|
#include <stack>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include "builder.h"
|
#include "triton/ir/builder.h"
|
||||||
#include "metadata.h"
|
#include "triton/ir/metadata.h"
|
||||||
|
|
||||||
namespace triton{
|
namespace triton{
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ class CMakeBuild(build_ext):
|
|||||||
python_lib_dirs = distutils.sysconfig.get_config_var('LIBDIR')
|
python_lib_dirs = distutils.sysconfig.get_config_var('LIBDIR')
|
||||||
torch_include_dirs = include_paths(True)
|
torch_include_dirs = include_paths(True)
|
||||||
torch_library_dirs = library_paths(True)
|
torch_library_dirs = library_paths(True)
|
||||||
abi = torch._C._GLIBCXX_USE_CXX11_ABI
|
cxx11abi = str(int(torch._C._GLIBCXX_USE_CXX11_ABI))
|
||||||
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
|
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
|
||||||
'-DBUILD_TESTS=OFF',
|
'-DBUILD_TESTS=OFF',
|
||||||
'-DBUILD_PYTHON_MODULE=ON',
|
'-DBUILD_PYTHON_MODULE=ON',
|
||||||
@@ -70,6 +70,7 @@ class CMakeBuild(build_ext):
|
|||||||
#'-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON,
|
#'-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON,
|
||||||
'-DPYTHON_INCLUDE_DIRS=' + ';'.join([python_include_dirs] + include_paths(True)),
|
'-DPYTHON_INCLUDE_DIRS=' + ';'.join([python_include_dirs] + include_paths(True)),
|
||||||
'-DPYTHON_LINK_DIRS=' + ';'.join(library_paths(True)),
|
'-DPYTHON_LINK_DIRS=' + ';'.join(library_paths(True)),
|
||||||
|
'-DTORCH_CXX11_ABI=' + cxx11abi,
|
||||||
'-DTORCH_LIBRARIES=c10;c10_cuda;torch;torch_cuda;torch_cpu;torch_python;triton',
|
'-DTORCH_LIBRARIES=c10;c10_cuda;torch;torch_cuda;torch_cpu;torch_python;triton',
|
||||||
'-DLLVM_CONFIG=' + find_llvm()]
|
'-DLLVM_CONFIG=' + find_llvm()]
|
||||||
# configuration
|
# configuration
|
||||||
|
Reference in New Issue
Block a user