[CI] Made build-wheels compatible with system LLVM setup (#138)
This speeds up wheelhouse build time by ~10x
This commit is contained in:
committed by
Philippe Tillet
parent
8eb63bcb01
commit
76c6f24fb6
@@ -16,7 +16,7 @@ jobs:
|
||||
set -o errexit
|
||||
python3 --version
|
||||
python3 -m pip install --upgrade pip
|
||||
pip3 install cibuildwheel==1.10.0
|
||||
pip3 install cibuildwheel==2.0.0
|
||||
pip3 install twine
|
||||
displayName: Install dependencies
|
||||
- bash: |
|
||||
@@ -28,7 +28,11 @@ jobs:
|
||||
echo "base-dir=/project" >> python/setup.cfg
|
||||
displayName: Patch setup.py
|
||||
- bash: |
|
||||
export CIBW_BEFORE_BUILD="pip install cmake"
|
||||
export CIBW_MANYLINUX_X86_64_IMAGE="manylinux2014"
|
||||
export CIBW_MANYLINUX_PYPY_X86_64_IMAGE="manylinux2014"
|
||||
export CIBW_BEFORE_BUILD="pip install cmake;\
|
||||
yum install -y llvm11 llvm11-devel llvm11-static llvm11-libs zlib-devel;"
|
||||
export CIBW_SKIP="{cp,pp}35-*"
|
||||
export CIBW_BUILD="{cp,pp}3*-manylinux_x86_64"
|
||||
python3 -m cibuildwheel python --output-dir wheelhouse
|
||||
displayName: Build wheels
|
||||
|
@@ -53,7 +53,6 @@ if(BUILD_PYTHON_MODULE)
|
||||
add_definitions(-DWITH_CUTLASS_BINDINGS)
|
||||
set(CUTLASS_LIBRARIES "cutlass.a")
|
||||
endif()
|
||||
message(STATUS ${CUTLASS_INCLUDE_PATH})
|
||||
include_directories("." ${PYTHON_SRC_PATH} ${PYTHON_INCLUDE_DIRS} ${CUTLASS_INCLUDE_DIR})
|
||||
link_directories(${PYTHON_LINK_DIRS} ${CUTLASS_LIBRARY_DIR})
|
||||
set(PYTHON_SRC ${PYTHON_SRC_PATH}/main.cc ${PYTHON_SRC_PATH}/triton.cc ${PYTHON_SRC_PATH}/superblock.cc ${CUTLASS_SRC})
|
||||
@@ -65,7 +64,7 @@ file(GLOB_RECURSE LIBTRITON_SRC lib/*.cc)
|
||||
add_library(triton SHARED ${LIBTRITON_SRC} ${PYTHON_SRC})
|
||||
target_link_options(triton PRIVATE ${LLVM_LDFLAGS})
|
||||
target_link_libraries(triton ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})
|
||||
message(STATUS ${LLVM_LDFLAGS})
|
||||
|
||||
|
||||
if(BUILD_PYTHON_MODULE)
|
||||
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
|
||||
|
@@ -33,12 +33,12 @@
|
||||
# We also want an user-specified LLVM_ROOT_DIR to take precedence over the
|
||||
# system default locations such as /usr/local/bin. Executing find_program()
|
||||
# multiples times is the approach recommended in the docs.
|
||||
set(llvm_config_names llvm-config-12.0 llvm-config120 llvm-config-12
|
||||
llvm-config-11.0 llvm-config110 llvm-config-11
|
||||
llvm-config-10.0 llvm-config100 llvm-config-10
|
||||
llvm-config-9.0 llvm-config90 llvm-config-9
|
||||
llvm-config-8.0 llvm-config80 llvm-config-8
|
||||
llvm-config-7.0 llvm-config70 llvm-config-7
|
||||
set(llvm_config_names llvm-config-12.0 llvm-config120 llvm-config-12 llvm-config-12-64
|
||||
llvm-config-11.0 llvm-config110 llvm-config-11 llvm-config-11-64
|
||||
llvm-config-10.0 llvm-config100 llvm-config-10 llvm-config-10-64
|
||||
llvm-config-9.0 llvm-config90 llvm-config-9 llvm-config-9-64
|
||||
llvm-config-8.0 llvm-config80 llvm-config-8 llvm-config-8-64
|
||||
llvm-config-7.0 llvm-config70 llvm-config-7 llvm-config-7-64
|
||||
llvm-config-6.0 llvm-config60
|
||||
llvm-config)
|
||||
find_program(LLVM_CONFIG
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#define _TRITON_IR_DISPATCH_H_
|
||||
|
||||
#include "triton/ir/builder.h"
|
||||
#include <stdexcept>
|
||||
|
||||
namespace triton{
|
||||
namespace ir{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
#include "triton/ir/constant.h"
|
||||
#include "triton/ir/type.h"
|
||||
#include "triton/ir/context.h"
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
#include "triton/ir/type.h"
|
||||
#include "triton/ir/context.h"
|
||||
#include "triton/ir/context_impl.h"
|
||||
|
@@ -7,12 +7,14 @@ import subprocess
|
||||
import distutils
|
||||
import glob
|
||||
import tempfile
|
||||
import shutil
|
||||
from distutils.version import LooseVersion
|
||||
from setuptools import setup, Extension, find_packages
|
||||
from setuptools.command.build_ext import build_ext
|
||||
from setuptools.command.test import test as TestCommand
|
||||
import distutils.spawn
|
||||
|
||||
import urllib.request
|
||||
import tarfile
|
||||
|
||||
class CMakeExtension(Extension):
|
||||
def __init__(self, name, path, sourcedir=""):
|
||||
@@ -66,7 +68,7 @@ class CMakeBuild(build_ext):
|
||||
"-DBUILD_TUTORIALS=OFF",
|
||||
"-DBUILD_PYTHON_MODULE=ON",
|
||||
#'-DPYTHON_EXECUTABLE=' + sys.executable,
|
||||
'-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON',
|
||||
#'-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON',
|
||||
"-DTRITON_LLVM_BUILD_DIR=" + llvm_build_dir,
|
||||
"-DPYTHON_INCLUDE_DIRS=" + ";".join(python_include_dirs)
|
||||
]
|
||||
|
Reference in New Issue
Block a user