Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix factorization #729

Merged
merged 15 commits into from
Mar 15, 2019
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ src/interface_py/build_info.txt

# Temp requirement file generated for Conda
src/interface_py/requirements_conda.txt
open_data/
open_data/*
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FIND_PACKAGE(BLAS REQUIRED)
FIND_PACKAGE(SWIG REQUIRED)
FIND_PACKAGE(PythonLibs REQUIRED) # SWIG

# SWIG behaviour was changed
# SWIG behaviour was changed
if (${CMAKE_VERSION} VERSION_GREATER "3.13")
cmake_policy(SET CMP0078 OLD)
endif()
Expand All @@ -20,6 +20,7 @@ INCLUDE(${SWIG_USE_FILE})
#============= OPTIONS & SETTINGS
OPTION(USE_CUDA "Build with GPU acceleration" ON)
OPTION(DEV_BUILD "Dev build" OFF)
OPTION(DEV_SYNC "call cudaDeviceSynchronize after each cuda call" OFF)

# Compiler flags
SET(CMAKE_CXX_STANDARD 11)
Expand Down Expand Up @@ -108,12 +109,16 @@ if(USE_CUDA)
MESSAGE(STATUS "Building DEVELOPER compute capability version.")
SET(GPU_COMPUTE_VER 61)
SET(CMAKE_BUILD_TYPE Debug)
# add_compile_definitions(SYNC)
else()
MESSAGE(STATUS "Building RELEASE compute capability version.")
SET(GPU_COMPUTE_VER 35;50;52;60;61)
endif()

if(DEV_SYNC)
MESSAGE(STATUS "Building with device sync.")
add_compile_definitions(SYNC)
endif()

if(((CUDA_VERSION_MAJOR EQUAL 9) OR (CUDA_VERSION_MAJOR GREATER 9)) AND NOT DEV_BUILD)
MESSAGE(STATUS "CUDA GREATER OR EQUAL THAN 9.0 detected, adding Volta compute capability (7.0).")
SET(GPU_COMPUTE_VER "${GPU_COMPUTE_VER};70")
Expand All @@ -127,7 +132,7 @@ if(USE_CUDA)
SET(GENCODE_FLAGS "")
FORMAT_GENCODE_FLAGS("${GPU_COMPUTE_VER}" GENCODE_FLAGS)
MESSAGE(STATUS "cuda architecture flags: ${GENCODE_FLAGS}")
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-Xcompiler -fPIC; -std=c++11;--expt-extended-lambda;--expt-relaxed-constexpr;${GENCODE_FLAGS};-lineinfo; -w;")
SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-Xcompiler -fPIC; -g; -std=c++11;--expt-extended-lambda;--expt-relaxed-constexpr;${GENCODE_FLAGS};-lineinfo; -w;")

FILE(GLOB_RECURSE GPU_SOURCES
src/*.cu
Expand All @@ -144,7 +149,7 @@ if(USE_CUDA)
SET(NVTX_LIBRARY nvToolsExt)
endif()

find_library(CUBLAS_STATIC_LIB NAMES libcublas_static.a
find_library(CUBLAS_STATIC_LIB NAMES libcublas_static.a
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" # cuda-9
"${CUDA_TOOLKIT_ROOT_DIR}/targets/x86_64-linux/lib/") # cuda-10
find_library(CULIBOS_STATIC_LIB NAMES libculibos.a
Expand All @@ -156,7 +161,7 @@ if(USE_CUDA)
find_library(CUSOLVER_STATIC_LIB NAMES libcusolver_static.a
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64"
"${CUDA_TOOLKIT_ROOT_DIR}/targets/x86_64-linux/lib/")


TARGET_LINK_LIBRARIES(gpuh2o4gpu
${CUBLAS_STATIC_LIB}
Expand All @@ -176,7 +181,7 @@ if(USE_CUDA)
else()
SWIG_ADD_LIBRARY(ch2o4gpu_gpu LANGUAGE python SOURCES src/swig/ch2o4gpu_gpu.i)
endif()
SWIG_LINK_LIBRARIES(ch2o4gpu_gpu gpuh2o4gpu
SWIG_LINK_LIBRARIES(ch2o4gpu_gpu gpuh2o4gpu
${PYTHON_LIBRARIES}
${CUBLAS_STATIC_LIB}
${CULIBOS_STATIC_LIB}
Expand Down
6 changes: 3 additions & 3 deletions DEVEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ rm -rf /opt/boost
mkdir -p /opt/boost
export CUDA_HOME=/usr/local/cuda/
apt-get install -y opencl-headers libicu-dev bzip2 libbz2-dev zlib1g-dev python-dev && \
wget http://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2 && \
tar xjf boost_1_61_0.tar.bz2 && \
cd boost_1_61_0 && \
wget https://s3.amazonaws.com/0xdata-public/boost/boost_1_69_0.tar.bz2 && \
tar xjf boost_1_69_0.tar.bz2 && \
cd boost_1_69_0 && \
export PYTHON_PREFIX=`python3-config --prefix` && \
./bootstrap.sh --prefix=/opt/boost/ --with-python=python3 && \
export PYTHON_INCLUDES=`python3-config --includes` && \
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile-build
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ RUN \
git clone https://github.com/NVIDIA/nccl.git && \
cd nccl && \
git checkout tags/v2.4.2-1 && \
make src.build;
make -j src.build;


COPY src/interface_py/requirements_buildonly.txt requirements_buildonly.txt
Expand All @@ -187,9 +187,9 @@ ENV LANGUAGE en_US:en
RUN \
export CUDA_HOME=/usr/local/cuda/ && \
yum install -y opencl-headers icu libicu-devel bzip2 bzip2-devel zlib-devel python-devel && \
wget http://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2 && \
tar xjf boost_1_61_0.tar.bz2 && \
cd boost_1_61_0 && \
wget https://s3.amazonaws.com/0xdata-public/boost/boost_1_69_0.tar.bz2 && \
tar xjf boost_1_69_0.tar.bz2 && \
cd boost_1_69_0 && \
export PYTHONPATH=/opt/h2oai/h2o4gpu/python/ && \
./bootstrap.sh --prefix=/opt/boost/ --with-python=python3 && \
export CPPFLAGS="-I/opt/h2oai/h2o4gpu/python/include/python3.6m/ -fPIC" && \
Expand Down
Loading