Skip to content

Commit

Permalink
Merge pull request #11 from Salonijain27/pr/9
Browse files Browse the repository at this point in the history
Pr/9
  • Loading branch information
Salonijain27 authored May 6, 2019
2 parents b6b425a + 14a53a2 commit 757666d
Show file tree
Hide file tree
Showing 47 changed files with 3,149 additions and 3,509 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
- PR #444: Added supervised training to UMAP
- PR #460: Random Forest & Decision Trees (Single-GPU, Classification
- PR #491: added doxygen build target for ml-prims
- PR #505: Adding R-Squared Score to python interface
- PR #507: Added coordinate descent for lasso and elastic-net
- PR #511: a minmax ml-prim
- PR #520: Add local build script to mimic gpuCI
- PR #503: Added column-wise matrix sort primitive
- PR #525: Add docs build script to cuML
- PR #528: Remove current KMeans and replace it with a new single GPU implementation built using ML primitives

## Improvements

Expand All @@ -41,6 +43,7 @@
- PR #524: Use cmake find blas and find lapack to pass configure options to faiss
- PR #527: Added notes on UMAP differences from reference implementation
- PR #540: Use latest release version in update-version CI script
- PR #552: Re-enable assert in kmeans tests with xfail as needed

## Bug Fixes

Expand Down Expand Up @@ -72,6 +75,9 @@
- PR #519: README.md Updates and adding BUILD.md back
- PR #526: Fix the issue of wrong results when fit and transform of PCA are called separately
- PR #531: Fixing missing arguments in updateDevice() for RF
- PR #543: Exposing dbscan batch size through cython API and fixing broken batching
- PR #551: Made use of ZLIB_LIBRARIES consistent between ml_test and ml_mg_test
- PR #557: Modified CI script to run cuML tests before building mlprims and removed lapack flag

# cuML 0.6.0 (22 Mar 2019)

Expand Down
25 changes: 14 additions & 11 deletions ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ logger "Build cuML..."
cd $WORKSPACE/python
python setup.py build_ext --inplace

logger "Build ml-prims tests..."
mkdir -p $WORKSPACE/ml-prims/build
cd $WORKSPACE/ml-prims/build
cmake $GPU_ARCH ..

logger "Clean up make..."
make clean
logger "Make ml-prims test..."
make -j${PARALLEL_LEVEL}


################################################################################
# TEST - Run GoogleTest and py.tests for libcuml and cuML
Expand All @@ -104,12 +94,25 @@ logger "GoogleTest for libcuml..."
cd $WORKSPACE/cuML/build
GTEST_OUTPUT="xml:${WORKSPACE}/test-results/libcuml_cpp/" ./ml_test


logger "Python py.test for cuML..."
cd $WORKSPACE/python
py.test --cache-clear --junitxml=${WORKSPACE}/junit-cuml.xml -v


################################################################################
# TEST - Build and run ml-prim tests
################################################################################

logger "Build ml-prims tests..."
mkdir -p $WORKSPACE/ml-prims/build
cd $WORKSPACE/ml-prims/build
cmake $GPU_ARCH ..

logger "Clean up make..."
make clean
logger "Make ml-prims test..."
make -j${PARALLEL_LEVEL}

logger "Run ml-prims test..."
cd $WORKSPACE/ml-prims/build
GTEST_OUTPUT="xml:${WORKSPACE}/test-results/ml-prims/" ./test/mlcommon_test
12 changes: 5 additions & 7 deletions cuML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ endif(NOT CMAKE_CXX11_ABI)
include (ExternalProject)
ExternalProject_Add(faiss
SOURCE_DIR ${FAISS_DIR}
CONFIGURE_COMMAND LIBS=-pthread CPPFLAGS=-w LDFLAGS=-L${CMAKE_INSTALL_PREFIX}/lib ${FAISS_DIR}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/faiss --with-blas=${BLAS_LIBRARIES} --with-lapack=${LAPACK_LIBRARIES} --with-cuda=${CUDA_TOOLKIT_ROOT_DIR} --quiet
CONFIGURE_COMMAND LIBS=-pthread CPPFLAGS=-w LDFLAGS=-L${CMAKE_INSTALL_PREFIX}/lib ${FAISS_DIR}/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/faiss --with-blas=${BLAS_LIBRARIES} --with-cuda=${CUDA_TOOLKIT_ROOT_DIR} --quiet
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/faiss/
BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) -s install > /dev/null || $(MAKE) && cd gpu && $(MAKE) -s install > /dev/null || $(MAKE)
Expand Down Expand Up @@ -209,7 +209,7 @@ file(GLOB_RECURSE cuml_test_cuda_sources "test/*.cu")
file(GLOB_RECURSE cuml_mg_test_cuda_sources "test_mg/*.cu")

###################################################################################################
# - build libcuml shared library ------------------------------------------------------------------
# - build libcuml++ shared library ------------------------------------------------------------------
set(CUML_CPP_TARGET "cuml++")
add_library(${CUML_CPP_TARGET} SHARED
src/pca/pca.cu
Expand All @@ -223,6 +223,7 @@ add_library(${CUML_CPP_TARGET} SHARED
src/common/cuml_api.cpp
src/umap/umap.cu
src/solver/solver.cu
src/metrics/metrics.cu
src/decisiontree/decisiontree.cu
src/randomforest/randomforest.cu)

Expand All @@ -235,8 +236,7 @@ set(CUML_LINK_LIBRARIES
${CUDA_nvgraph_LIBRARY}
${ZLIB_LIBRARIES}
gpufaisslib
faisslib
${BLAS_LIBRARIES})
faisslib)

if(OPENMP_FOUND)
set(CUML_LINK_LIBRARIES ${CUML_LINK_LIBRARIES} OpenMP::OpenMP_CXX pthread)
Expand All @@ -260,10 +260,9 @@ target_link_libraries(ml_test
${CUDA_cusparse_LIBRARY}
${CUDA_nvgraph_LIBRARY}
faisslib
${BLAS_LIBRARIES}
${CUML_CPP_TARGET}
pthread
z)
${ZLIB_LIBRARIES})

###################################################################################################
# - build test executable -------------------------------------------------------------------------
Expand All @@ -281,7 +280,6 @@ target_link_libraries(ml_mg_test
${CUDA_nvgraph_LIBRARY}
gpufaisslib
faisslib
${BLAS_LIBRARIES}
${CUML_CPP_TARGET}
pthread
${ZLIB_LIBRARIES})
Expand Down
13 changes: 8 additions & 5 deletions cuML/examples/dbscan/dbscan_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ void printUsage()
<< "-num_samples <number of samples> -num_features <number of features> "
<< "[-min_pts <minimum number of samples in a cluster>] "
<< "[-eps <maximum distance between any two samples of a cluster>] "
<< "[-max_bytes_per_batch <maximum memory to use (in bytes) for batch size calculation>] "
<< std::endl;
return;
}

void loadDefaultDataset(std::vector<float>& inputData, size_t& nRows,
size_t& nCols, int& minPts, float& eps)
size_t& nCols, int& minPts, float& eps, size_t& max_bytes_per_batch)
{
constexpr size_t NUM_ROWS = 25;
constexpr size_t NUM_COLS = 3;
Expand Down Expand Up @@ -122,6 +123,7 @@ void loadDefaultDataset(std::vector<float>& inputData, size_t& nRows,
nCols = NUM_COLS;
minPts = MIN_PTS;
eps = EPS;
max_bytes_per_batch = 0; // allow algorithm to set this

inputData.insert(inputData.begin(), data, data+nRows*nCols);
}
Expand Down Expand Up @@ -167,6 +169,7 @@ int main(int argc, char * argv[])
get_argval<std::string>(argv, argv+argc,"-input", std::string(""));
int minPts = get_argval<int>(argv, argv+argc, "-min_pts", 3);
float eps = get_argval<float>(argv, argv+argc, "-eps", 1.0f);
size_t max_bytes_per_batch = get_argval<size_t>(argv, argv+argc, "-max_bytes_per_batch", (size_t)2e7);

{
cudaError_t cudaStatus = cudaSuccess;
Expand Down Expand Up @@ -215,7 +218,7 @@ int main(int argc, char * argv[])
// Samples file not specified, run with defaults
std::cout << "Samples file not specified. (-input option)" << std::endl;
std::cout << "Running with default dataset:" << std::endl;
loadDefaultDataset(h_inputData, nRows, nCols, minPts, eps);
loadDefaultDataset(h_inputData, nRows, nCols, minPts, eps, max_bytes_per_batch);
}
else if(nRows == 0 || nCols == 0)
{
Expand Down Expand Up @@ -274,10 +277,10 @@ int main(int argc, char * argv[])
<< "Number of samples - " << nRows << std::endl
<< "Number of features - " << nCols << std::endl
<< "min_pts - " << minPts << std::endl
<< "eps - " << eps
<< std::endl;
<< "eps - " << eps << std::endl
<< "max_bytes_per_batch - " << max_bytes_per_batch << std::endl;

ML::dbscanFit(cumlHandle, d_inputData, nRows, nCols, eps, minPts, d_labels);
ML::dbscanFit(cumlHandle, d_inputData, nRows, nCols, eps, minPts, d_labels, max_bytes_per_batch);
CUDA_RT_CALL( cudaMemcpyAsync(h_labels.data(), d_labels, nRows*sizeof(int),
cudaMemcpyDeviceToHost, stream) );
CUDA_RT_CALL( cudaStreamSynchronize(stream) );
Expand Down
Loading

0 comments on commit 757666d

Please sign in to comment.