Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/branch-0.8' into branch-0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rlratzel committed May 24, 2019
2 parents d96db05 + d488887 commit c2d5fb8
Show file tree
Hide file tree
Showing 107 changed files with 14,957 additions and 13,794 deletions.
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "cpp/nvgraph/cpp/thirdparty/cnmem"]
path = cpp/nvgraph/cpp/thirdparty/cnmem
url = https://github.com/NVIDIA/cnmem.git
branch = master
[submodule "cpp/nvgraph/cpp/thirdparty/cub"]
path = cpp/nvgraph/cpp/thirdparty/cub
url = https://github.com/NVlabs/cub.git
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# cuGraph 0.8.0 (Date TBD)

## New Features
- PR #287 SNMG power iteration step1
- PR #297 SNMG degree calculation

## Improvements
- PR #291 nvGraph is updated to use RMM instead of directly invoking cnmem functions.
- PR #286 Reorganized cugraph source directory


## Bug Fixes
- PR #283 Automerge fix
- PR #291 Fixed a RMM memory allocation failure due to duplicate copies of cnmem.o
- PR #291 Fixed a cub CsrMV call error when RMM pool allocator is used.

# cuGraph 0.7.0 (Date TBD)

## New Features
Expand Down Expand Up @@ -54,6 +70,7 @@
- PR #262 Removed networkx conda dependency for both build and runtime
- PR #271 Removed nvgraph conda dependency
- PR #276 Removed libgdf_cffi import from bindings
- PR #288 Add boost as a conda dependency

# cuGraph 0.6.0 (22 Mar 2019)

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ These limitations are being addressed and will be fixed future versions.

## Getting cuGraph
### Intro
There are 4 ways to get cuGraph :
There are 3 ways to get cuGraph :
1. [Quick start with Docker Demo Repo](#quick)
1. [Conda Installation](#conda)
1. [Build from Source](#source)
Expand Down Expand Up @@ -133,5 +133,4 @@ The RAPIDS suite of open source software libraries aim to enable execution of en

### Apache Arrow on GPU

The GPU version of [Apache Arrow](https://arrow.apache.org/) is a common API that enables efficient interchange of tabular data between processes running on the GPU. End-to-end computation on the GPU avoids unnecessary copying and converting of data off the GPU, reducing compute time and cost for high-performance analytics common in artificial intelligence workloads. As the name implies, cuDF uses the Apache Arrow columnar data format on the GPU. Currently, a subset of the features in Apache Arrow are supported.

The GPU version of [Apache Arrow](https://arrow.apache.org/) is a common API that enables efficient interchange of tabular data between processes running on the GPU. End-to-end computation on the GPU avoids unnecessary copying and converting of data off the GPU, reducing compute time and cost for high-performance analytics common in artificial intelligence workloads. As the name implies, cuDF uses the Apache Arrow columnar data format on the GPU. Currently, a subset of the features in Apache Arrow are supported.
4 changes: 2 additions & 2 deletions conda/recipes/cugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ requirements:
build:
- python x.x
- libcugraph={{ version }}
- cudf=0.7*
- cudf=0.8*
run:
- python x.x
- libcugraph={{ version }}
- cudf=0.7*
- cudf=0.8*

#test:
# commands:
Expand Down
8 changes: 4 additions & 4 deletions conda/recipes/libcugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ build:
requirements:
build:
- cmake>=3.12.4
- libcudf=0.7*
- libcudf=0.8*
- cython
- cudatoolkit {{ cuda_version }}.*
- boost-cpp
- boost
run:
- libcudf=0.7*
- libcudf=0.8*
- cython
- {{ pin_compatible('cudatoolkit', max_pin='x.x') }}
- boost-cpp
- boost

#test:
# commands:
Expand Down
27 changes: 17 additions & 10 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#=============================================================================
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

project(cuGraph VERSION 0.6.0 LANGUAGES C CXX CUDA)
project(cuGraph VERSION 0.8.0 LANGUAGES C CXX CUDA)

###################################################################################################
# - cmake modules ---------------------------------------------------------------------------------
Expand Down Expand Up @@ -136,7 +136,7 @@ include(ConfigureNvgraph)

###################################################################################################
# - Find and add different modules and supporting repos -------------------------------------------
find_package(Boost 1.45.0 COMPONENTS system)
find_package(Boost REQUIRED)

find_package(OpenMP)
if (OPENMP_FOUND)
Expand Down Expand Up @@ -229,14 +229,21 @@ link_directories("${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}" # CMAKE_CUDA_IMPLICIT
###################################################################################################
# - library targets -------------------------------------------------------------------------------
add_library(cugraph SHARED
src/grmat.cu
src/cugraph.cu
src/pagerank.cu
src/bfs.cu
src/jaccard.cu
src/overlap.cu
src/nvgraph_gdf.cu
src/two_hop_neighbors.cu
src/utilities/grmat.cu
src/utilities/degree.cu
src/structure/cugraph.cu
src/link_analysis/pagerank.cu
src/traversal/bfs.cu
src/link_prediction/jaccard.cu
src/link_prediction/overlap.cu
src/converters/nvgraph.cu
src/converters/renumber.cu
src/community/nvgraph_gdf.cu
src/traversal/nvgraph_sssp.cu
src/traversal/two_hop_neighbors.cu
src/snmg/blas/spmv.cu
src/snmg/degree/degree.cu
src/snmg/utils.cu
${CMAKE_CURRENT_BINARY_DIR}/gunrock/gunrock/util/test_utils.cu
${CMAKE_CURRENT_BINARY_DIR}/gunrock/gunrock/util/error_utils.cu
${CMAKE_CURRENT_BINARY_DIR}/gunrock/gunrock/util/misc_utils.cu
Expand Down
16 changes: 16 additions & 0 deletions cpp/include/algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,19 @@ gdf_error gdf_louvain(gdf_graph *graph,
void *final_modularity,
void *num_level,
gdf_column *louvain_parts);

/**
* Computes the in-degree, out-degree, or the sum of both (determined by x) for the given graph. This is
* a multi-gpu operation operating on a partitioned graph.
* @param x 0 for in+out, 1 for in, 2 for out
* @param part_offsets Contains the start/end of each partitions vertex id range
* @param off The local partition offsets
* @param ind The local partition indices
* @param x_cols The results (located on each GPU)
* @return Error code
*/
gdf_error gdf_snmg_degree(int x,
size_t* part_offsets,
gdf_column* off,
gdf_column* ind,
gdf_column** x_cols);
56 changes: 2 additions & 54 deletions cpp/include/rmm_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/
#pragma once
///#define DEBUG_NO_RMM

#include <sstream>
#include <stdexcept>
Expand All @@ -27,68 +26,17 @@
throw std::runtime_error(ss.str()); \
}

#ifdef DEBUG_NO_RMM

#include <thrust/device_malloc_allocator.h>
#include <thrust/system_error.h>
#include <thrust/system/cuda/error.h>
#include <thrust/execution_policy.h>

template<typename T>
//using rmm_allocator = thrust::device_malloc_allocator<T>;
class rmm_allocator : public thrust::device_malloc_allocator<T>
{
public:
using value_type = T;

rmm_allocator(cudaStream_t stream = 0) : stream(stream) {}
~rmm_allocator() {}

private:
cudaStream_t stream;
};

using rmm_temp_allocator = rmm_allocator<char>; // Use this alias for thrust::cuda::par(allocator).on(stream)

#define ALLOC_TRY(ptr, sz, stream){ \
if (stream == nullptr) ; \
cudaMalloc((ptr), (sz)); \
}

#define ALLOC_MANAGED_TRY(ptr, sz, stream){ \
if (stream == nullptr) ; \
cudaMallocManaged((ptr), (sz)); \
}

//#define REALLOC_TRY(ptr, new_sz, stream)

#define ALLOC_FREE_TRY(ptr, stream){ \
if (stream == nullptr) ; \
cudaFree( (ptr) ); \
}
#else

#include <rmm/rmm.h>
#include <rmm/thrust_rmm_allocator.h>

using rmm_temp_allocator = rmm_allocator<char>;

#define ALLOC_TRY( ptr, sz, stream ){ \
RMM_TRY_THROW( RMM_ALLOC((ptr), (sz), (stream)) ) \
}

//TODO: change this when RMM alloc managed will be available !!!!!
#define ALLOC_MANAGED_TRY(ptr, sz, stream){ \
#define ALLOC_TRY( ptr, sz, stream ){ \
RMM_TRY_THROW( RMM_ALLOC((ptr), (sz), (stream)) ) \
}

#define REALLOC_TRY(ptr, new_sz, stream){ \
RMM_TRY_THROW( RMM_REALLOC((ptr), (sz), (stream)) ) \
}

#define ALLOC_FREE_TRY(ptr, stream){ \
#define ALLOC_FREE_TRY(ptr, stream){ \
RMM_TRY_THROW( RMM_FREE( (ptr), (stream) ) ) \
}

#endif

34 changes: 26 additions & 8 deletions cpp/nvgraph/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ project(NV_GRAPH VERSION 0.4.0 LANGUAGES C CXX CUDA)
###################################################################################################
# - compiler options ------------------------------------------------------------------------------

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_COMPILER $ENV{CC})
set(CMAKE_CXX_COMPILER $ENV{CXX})
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

if(CMAKE_COMPILER_IS_GNUCXX)
Expand All @@ -47,7 +47,7 @@ option(BUILD_TESTS "Configure CMake to build tests"
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")

option(CMAKE_CXX11_ABI "Enable the GLIBCXX11 ABI" OFF)
option(CMAKE_CXX11_ABI "Enable the GLIBCXX11 ABI" ON)
if(CMAKE_CXX11_ABI)
message(STATUS "nvGraph: Enabling the GLIBCXX11 ABI")
else()
Expand All @@ -67,6 +67,25 @@ include(FeatureSummary)
include(CheckIncludeFiles)
include(CheckLibraryExists)

###################################################################################################
# - add rmm --------------------------------------------------------------------------------------
find_path(RMM_INCLUDE "rmm"
HINTS "$ENV{RMM_ROOT}/include"
"$ENV{CONDA_PREFIX}/include/rmm"
"$ENV{CONDA_PREFIX}/include")

find_library(RMM_LIBRARY "rmm"
HINTS "$ENV{RMM_ROOT}/lib"
"$ENV{CONDA_PREFIX}/lib")

message(STATUS "RMM: RMM_LIBRARY set to ${RMM_LIBRARY}")
message(STATUS "RMM: RMM_INCLUDE set to ${RMM_INCLUDE}")

add_library(rmm SHARED IMPORTED ${RMM_LIBRARY})
if (RMM_INCLUDE AND RMM_LIBRARY)
set_target_properties(rmm PROPERTIES IMPORTED_LOCATION ${RMM_LIBRARY})
endif (RMM_INCLUDE AND RMM_LIBRARY)

###################################################################################################
# - add gtest -------------------------------------------------------------------------------------

Expand All @@ -90,9 +109,9 @@ include_directories(
"${CMAKE_BINARY_DIR}/include"
"${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}/thirdparty/cub"
"${CMAKE_SOURCE_DIR}/thirdparty/cnmem/include"
"${CMAKE_SOURCE_DIR}/../external"
"${CMAKE_SOURCE_DIR}/../external/cusp"
"${RMM_INCLUDE}"
"${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}"
)

Expand All @@ -101,13 +120,13 @@ include_directories(

link_directories("${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}" # CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES is an undocumented/unsupported variable containing the link directories for nvcc
"${CMAKE_BINARY_DIR}/lib"
"${GTEST_LIBRARY_DIR}")
"${GTEST_LIBRARY_DIR}"
"${RMM_LIBRARY}")

###################################################################################################
# - library targets -------------------------------------------------------------------------------
if(NVGRAPH_LIGHT MATCHES True)
add_library(nvgraph_rapids SHARED
thirdparty/cnmem/src/cnmem.cpp
src/arnoldi.cu
src/bfs.cu
src/bfs2d.cu
Expand Down Expand Up @@ -141,7 +160,6 @@ if(NVGRAPH_LIGHT MATCHES True)
)
else(NVGRAPH_LIGHT MATCHES True)
add_library(nvgraph_rapids SHARED
thirdparty/cnmem/src/cnmem.cpp
src/arnoldi.cu
src/bfs.cu
src/bfs2d.cu
Expand Down Expand Up @@ -203,7 +221,7 @@ endif(NVGRAPH_LIGHT MATCHES True)
###################################################################################################
# - link libraries --------------------------------------------------------------------------------

target_link_libraries(nvgraph_rapids cublas cusparse curand cusolver cudart )
target_link_libraries(nvgraph_rapids cublas cusparse curand cusolver rmm cudart cuda)

###################################################################################################
# - install targets -------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit c2d5fb8

Please sign in to comment.