h2o4gpu

H2Oai GPU Edition

https://github.com/h2oai/h2o4gpu

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 27 committers (11.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.0%) to scientific vocabulary

Keywords

c-plus-plus cpu cuda elastic-net glm gpu lasso machine-learning pca python r rstats svd

Keywords from Contributors

gbm distributed automl ensemble-learning h2o h2o-automl hadoop naive-bayes gbdt gbrt
Last synced: 6 months ago · JSON representation

Repository

H2Oai GPU Edition

Basic Info
  • Host: GitHub
  • Owner: h2oai
  • License: apache-2.0
  • Language: C++
  • Default Branch: master
  • Homepage:
  • Size: 26.6 MB
Statistics
  • Stars: 469
  • Watchers: 130
  • Forks: 94
  • Open Issues: 155
  • Releases: 8
Topics
c-plus-plus cpu cuda elastic-net glm gpu lasso machine-learning pca python r rstats svd
Created almost 9 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

H2O4GPU

Join the chat at https://gitter.im/h2oai/h2o4gpu

H2O4GPU is a collection of GPU solvers by H2Oai with APIs in Python and R. The Python API builds upon the easy-to-use scikit-learn API and its well-tested CPU-based algorithms. It can be used as a drop-in replacement for scikit-learn (i.e. import h2o4gpu as sklearn) with support for GPUs on selected (and ever-growing) algorithms. H2O4GPU inherits all the existing scikit-learn algorithms and falls back to CPU algorithms when the GPU algorithm does not support an important existing scikit-learn class option. The R package is a wrapper around the H2O4GPU Python package, and the interface follows standard R conventions for modeling.

Daal library added for CPU, currently supported only x86_64 architecture.

Requirements

  • PC running Linux with glibc 2.17+

  • Install CUDA with bundled display drivers ( CUDA 8 or CUDA 9 or CUDA 9.2) or CUDA 10)

  • Python shared libraries (e.g. On Ubuntu: sudo apt-get install libpython3.6-dev)

When installing, choose to link the cuda install to /usr/local/cuda . Ensure to reboot after installing the new nvidia drivers.

  • Nvidia GPU with Compute Capability >= 3.5 (Capability Lookup).

  • For advanced features, like handling rows/32 > 2^16 (i.e., rows > 2,097,152) in K-means, need Capability >= 5.2

  • For building the R package, libcurl4-openssl-dev, libssl-dev, and libxml2-dev are needed.

User Installation

Note: Installation steps mentioned below are for users planning to use H2O4GPU. See DEVEL.md for developer installation.

H2O4GPU can be installed using either PIP or Conda

Prerequisites

Add to ~/.bashrc or environment (set appropriate paths for your OS):

export CUDA_HOME=/usr/local/cuda # or choose /usr/local/cuda9 for cuda9 and /usr/local/cuda8 for cuda8 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64/:$CUDA_HOME/lib/:$CUDA_HOME/extras/CUPTI/lib64

  • Install OpenBlas dev environment:

sudo apt-get install libopenblas-dev pbzip2

If you are building the h2o4gpu R package, it is necessary to install the following dependencies:

sudo apt-get -y install libcurl4-openssl-dev libssl-dev libxml2-dev

PIP install

Download the Python wheel file (For Python 3.6):

Start a fresh pyenv or virtualenv session.

Install the Python wheel file. NOTE: If you don't use a fresh environment, this will overwrite your py3nvml and xgboost installations to use our validated versions.

pip install h2o4gpu-0.3.0-cp36-cp36m-linux_x86_64.whl

Conda installation

Ensure you meet the Requirements and have installed the Prerequisites.

If not already done you need to install conda package manager. Ensure you test your conda installation

H204GPU packages for CUDA8, CUDA 9 and CUDA 9.2 are available from h2oai channel in anaconda cloud.

Create a new conda environment with H2O4GPU based on CUDA 9.2 and all its dependencies using the following command. For other cuda versions substitute the package name as needed. Note the requirement for h2oai and conda-forge channels.

bash conda create -n h2o4gpuenv -c h2oai -c conda-forge -c rapidsai h2o4gpu-cuda10

Once the environment is created activate it source activate h2o4gpuenv.

To test, start an interactive python session in the environment and follow the steps in the Test Installation section below.

h2o4gpu R package

At this point, you should have installed the H2O4GPU Python package successfully. You can then go ahead and install the h2o4gpu R package via the following:

r if (!require(devtools)) install.packages("devtools") devtools::install_github("h2oai/h2o4gpu", subdir = "src/interface_r")

Detailed instructions can be found here.

Test Installation

To test your installation of the Python package, the following code:

``` import h2o4gpu import numpy as np

X = np.array([[1.,1.], [1.,4.], [1.,0.]]) model = h2o4gpu.KMeans(nclusters=2,randomstate=1234).fit(X) model.clustercenters should give input/output of:

import h2o4gpu import numpy as np

X = np.array([[1.,1.], [1.,4.], [1.,0.]]) model = h2o4gpu.KMeans(nclusters=2,randomstate=1234).fit(X) model.clustercenters array([[ 1., 1. ], [ 1., 4. ]]) ```

To test your installation of the R package, try the following example that builds a simple XGBoost random forest classifier:

``` r library(h2o4gpu)

Setup dataset

x <- iris[1:4] y <- as.integer(iris$Species) - 1

Initialize and train the classifier

model <- h2o4gpu.randomforestclassifier() %>% fit(x, y)

Make predictions

predictions <- model %>% predict(x) ```

Next Steps

For more examples using Python API, please check out our Jupyter notebook demos. To run the demos using a local wheel run, at least download src/interface_py/requirements_runtime_demos.txt from the Github repo and do: pip install -r src/interface_py/requirements_runtime_demos.txt and then run the jupyter notebook demos.

For more examples using R API, please visit the vignettes.

Running Jupyter Notebooks

You can run Jupyter Notebooks with H2O4GPU in the below two ways

Creating a Conda Environment

Ensure you have a machine that meets the Requirements and Prerequisites mentioned above.

Next follow Conda installation instructions mentioned above. Once you have activated the environment, you will need to downgrade tornado to version 4.5.3 refer issue #680. Start Jupyter notebook, and navigate to the URL shown in the log output in your browser.

bash source activate h2o4gpuenv conda install tornado==4.5.3 jupyter notebook --ip='*' --no-browser Start a Python 3 kernel, and try the code in example notebooks

Using precompiled docker image

Requirements:

Download the Docker file (for linuxx8664):

  • Bleeding edge (changes with every successful master branch build):

Load and run docker file (e.g. for bleeding-edge of cuda92): jupyter notebook --generate-config echo "c.NotebookApp.allow_remote_access = False >> ~/.jupyter/jupyter_notebook_config.py # Choose True if want to allow remote access pbzip2 -dc h2o4gpu-0.3.0.10000-cuda92-runtime.tar.bz2 | nvidia-docker load mkdir -p log ; nvidia-docker run --name localhost --rm -p 8888:8888 -u `id -u`:`id -g` -v `pwd`/log:/log -v /home/$USER/.jupyter:/jupyter --entrypoint=./run.sh opsh2oai/h2o4gpu-0.3.0.10000-cuda92-runtime & find log -name jupyter* -type f -printf '%T@ %p\n' | sort -k1 -n | awk '{print $2}' | tail -1 | xargs cat | grep token | grep http | grep -v NotebookApp Copy/paste the http link shown into your browser. If the "find" command doesn't work, look for the latest jupyter.log file and look at contents for the http link and token.

If the link shows no token or shows ... for token, try a token of "h2o" (without quotes). If running on your own host, the weblink will look like http://localhost:8888:token with token replaced by the actual token.

This container has a /demos directory which contains Jupyter notebooks and some data.

Plans

The vision is to develop fast GPU algorithms to complement the CPU algorithms in scikit-learn while keeping full scikit-learn API compatibility and scikit-learn CPU algorithm capability. The h2o4gpu Python module is to be used as a drop-in-replacement for scikit-learn that has the full functionality of scikit-learn's CPU algorithms.

Functions and classes will be gradually overridden by GPU-enabled algorithms (unless n_gpu=0 is set and we have no CPU algorithm except scikit-learn's). The CPU algorithms and code initially will be sklearn, but gradually those may be replaced by faster open-source codes like those in Intel DAAL.

This vision is currently accomplished by using the open-source scikit-learn and xgboost and overriding scikit-learn calls with our own GPU versions. In cases when our GPU class is currently incapable of an important scikit-learn feature, we revert to the scikit-learn class.

As noted above, there is an R API in development, which will be released as a stand-alone R package. All algorithms supported by H2O4GPU will be exposed in both Python and R in the future.

Another primary goal is to support all operations on the GPU via the GOAI initiative. This involves ensuring the GPU algorithms can take and return GPU pointers to data instead of going back to the host. In scikit-learn API language these are called fit_ptr, predict_ptr, transform_ptr, etc., where ptr stands for memory pointer.

RoadMap

2019 Q2:

  • A new processing engine that allows to scale beyond GPU memory limits
  • k-Nearest Neighbors
  • Matrix Factorization
  • Factorization Machines
  • API Support: GOAI API support
  • Data.table support

More precise information can be found in the milestone's list.

Solver Classes

Among others, the solver can be used for the following classes of problems

  • GLM: Lasso, Ridge Regression, Logistic Regression, Elastic Net Regulariation
  • KMeans
  • Gradient Boosting Machine (GBM) via XGBoost
  • Singular Value Decomposition(SVD) + Truncated Singular Value Decomposition
  • Principal Components Analysis(PCA)

Benchmarks

Our benchmarking plan is to clearly highlight when modeling benefits from the GPU (usually complex models) or does not (e.g. one-shot simple models dominated by data transfer).

We have benchmarked h2o4gpu, scikit-learn, and h2o-3 on a variety of solvers. Some benchmarks have been performed for a few selected cases that highlight the GPU capabilities (i.e. compute or on-GPU memory operations dominate data transfer to GPU from host):

Benchmarks for GLM, KMeans, and XGBoost for CPU vs. GPU.

A suite of benchmarks are computed when doing "make testperf" from a build directory. These take all of our tests and benchmarks h2o4gpu against h2o-3. These will soon be presented as a live commit-by-commit streaming plots on a website.

Contributing

Please refer to our CONTRIBUTING.md and DEVEL.md for instructions on how to build and test the project and how to contribute. The h2o4gpu Gitter chatroom can be used for discussion related to open source development.

GitHub issues are used for bugs, feature and enhancement discussion/tracking.

Questions

References

  1. Parameter Selection and Pre-Conditioning for a Graph Form Solver -- C. Fougner and S. Boyd
  2. Block Splitting for Distributed Optimization -- N. Parikh and S. Boyd
  3. Distributed Optimization and Statistical Learning via the Alternating Direction Method of Multipliers -- S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein
  4. Proximal Algorithms -- N. Parikh and S. Boyd

Copyright

``` Copyright (c) 2017, H2O.ai, Inc., Mountain View, CA Apache License Version 2.0 (see LICENSE file)

This software is based on original work under BSD-3 license by:

Copyright (c) 2015, Christopher Fougner, Stephen Boyd, Stanford University All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ```

Owner

  • Name: H2O.ai
  • Login: h2oai
  • Kind: organization
  • Location: Mountain View, CA

Fast Scalable Machine Learning For Smarter Applications

GitHub Events

Total
  • Issues event: 2
  • Watch event: 9
  • Delete event: 3
  • Issue comment event: 6
  • Pull request event: 8
  • Fork event: 1
  • Create event: 4
Last Year
  • Issues event: 2
  • Watch event: 9
  • Delete event: 3
  • Issue comment event: 6
  • Pull request event: 8
  • Fork event: 1
  • Create event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 2,152
  • Total Committers: 27
  • Avg Commits per committer: 79.704
  • Development Distribution Score (DDS): 0.585
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
pseudotensor p****r@g****m 894
navdeep-G m****l@g****m 287
Arno Candel a****l@g****m 268
mdymczyk d****k@g****m 206
Chris F c****r@g****m 144
Vladimir Ovsyannikov v****v@g****m 140
foges u****d@g****m 69
terrytangyuan t****n@g****m 39
bungun u****n@s****u 21
abal5 a****l@h****i 18
Anmol Bal a****l@h****m 13
Tom Kraljevic t****k@t****t 11
khevn k****n@g****m 11
stjoern m****r@g****m 7
ledell e****n@h****i 6
Far0n f****z@g****m 4
Hemen Kapadia h****a@g****m 2
Michal Raška m****r@h****i 2
Patrick Rice C****v 2
jr0m j****m@s****l 1
foges f****r@i****U 1
foges c****r@B****l 1
Chris f****r@i****r 1
Magnus Stensmo m****o 1
Rohan Rao r****8@g****m 1
meganjkurka 2****a 1
nkalonia1 n****1@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 38
  • Total pull requests: 71
  • Average time to close issues: 11 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 28
  • Total pull request authors: 12
  • Average comments per issue: 6.34
  • Average comments per pull request: 0.49
  • Merged pull requests: 43
  • Bot issues: 0
  • Bot pull requests: 6
Past Year
  • Issues: 1
  • Pull requests: 5
  • Average time to close issues: less than a minute
  • Average time to close pull requests: about 1 hour
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.6
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 5
Top Authors
Issue Authors
  • sh1ng (5)
  • MattiaVerticchio (2)
  • terrytangyuan (2)
  • retimadangol (2)
  • cetoh (2)
  • prateeksasan1 (2)
  • chriseal (2)
  • cpoptic (1)
  • Naresh-Eddula (1)
  • bkavlak (1)
  • nathanhack (1)
  • navdeep-G (1)
  • Swagician (1)
  • srikanth695 (1)
  • henrybm (1)
Pull Request Authors
  • sh1ng (46)
  • dependabot[bot] (11)
  • pseudotensor (7)
  • snyk-bot (3)
  • navdeep-G (3)
  • rsujeevan (2)
  • trivialfis (1)
  • arnocandel (1)
  • cclauss (1)
  • terrytangyuan (1)
  • vopani (1)
  • pnijhara (1)
Top Labels
Issue Labels
CUDA (2) new algo (2) feature request (2) cust-epsilon (2) build (1) enhancement (1) R (1)
Pull Request Labels
dependencies (11) javascript (2) Python (2) bug (1) enhancement (1)

Packages

  • Total packages: 2
  • Total downloads:
    • cran 272 last-month
  • Total docker downloads: 71
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 7
  • Total maintainers: 1
proxy.golang.org: github.com/h2oai/h2o4gpu
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 6 months ago
cran.r-project.org: h2o4gpu

Interface to 'H2O4GPU'

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 272 Last month
  • Docker Downloads: 71
Rankings
Forks count: 0.6%
Stargazers count: 0.9%
Average: 24.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 57.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

h2o4gpu-docs-theme/bower.json bower
  • wyrm ~0.0.x
src/interface_r/DESCRIPTION cran
  • R >= 3.1 depends
  • magrittr * imports
  • reticulate >= 1.4 imports
  • utils * imports
  • Matrix * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
h2o4gpu-docs-theme/package.json npm
  • connect-livereload ~0.3.0 development
  • grunt ~0.4.1 development
  • grunt-contrib-clean 0.5.0 development
  • grunt-contrib-connect 0.5.0 development
  • grunt-contrib-copy 0.5.0 development
  • grunt-contrib-sass ~0.7.2 development
  • grunt-contrib-watch ~0.4.3 development
  • grunt-exec ~0.4.2 development
  • grunt-open 0.2.2 development
  • matchdep ~0.1.2 development
src/interface_py/requirements_buildonly.txt pypi
  • cython ==0.29.14
  • dask ==2.11.0
  • dask-cuda ==0.12.0
  • distributed ==2.11.0
  • future ==0.16.0
  • joblib ==0.14.0
  • llvmlite ==0.30.0
  • msgpack ==0.6.2
  • numba ==0.46.0
  • numpy ==1.19.2
  • numpydoc ==0.8.0
  • pandas ==1.1.3
  • pillow ==7.2.0
  • psutil ==5.6.6
  • scikit-learn ==0.23.2
  • scipy ==1.5.2
  • sphinx ==1.8.5
  • sphinx_rtd_theme ==0.4.3
  • tabulate ==0.8.2
  • wheel ==0.33.4
src/interface_py/requirements_runtime.txt pypi
  • future >=0.16.0
  • joblib >=0.14.0
  • numpy >=1.16.4
  • pandas >=0.24.2
  • psutil >=5.6.3
  • python-dateutil >=2.7.2
  • pytz >=2018.4
  • scikit-learn ==0.23.2
  • scipy >=1.3.1
  • tabulate >=0.8.2
src/interface_py/requirements_runtime_demos_multi_gpu.txt pypi
  • Cython ==0.29.3
  • dask ==2.11.0
  • dask-cuda ==0.12.0
  • distributed ==2.11.0
  • feather-format ==0.4.1
  • future ==0.16.0
  • ipykernel ==4.8.2
  • ipython ==6.3.1
  • ipython_genutils ==0.2.0
  • ipywidgets ==6.0.0
  • joblib ==0.14.0
  • jupyter ==1.0.0
  • jupyter_client ==5.3.4
  • jupyter_console ==5.2.0
  • llvmlite ==0.30.0
  • matplotlib ==2.0.2
  • msgpack ==0.6.2
  • numba ==0.46.0
  • numpy ==1.19.2
  • pandas ==1.1.3
  • pillow ==7.2.0
  • psutil ==5.6.6
  • pyarrow ==0.17.1
  • python-dateutil ==2.7.2
  • pytz ==2018.4
  • scikit-learn ==0.23.2
  • scipy ==1.5.2
  • seaborn ==0.8.1
  • tabulate ==0.8.2
src/interface_py/requirements_runtime_demos_single_gpu.txt pypi
  • Cython ==0.29.3
  • feather-format ==0.4.1
  • future ==0.16.0
  • ipykernel ==4.8.2
  • ipython ==6.3.1
  • ipython_genutils ==0.2.0
  • ipywidgets ==6.0.0
  • joblib ==0.14.0
  • jupyter ==1.0.0
  • jupyter_client ==5.3.4
  • jupyter_console ==5.2.0
  • matplotlib ==2.0.2
  • numpy ==1.19.2
  • pandas ==1.1.3
  • pillow ==7.2.0
  • psutil ==5.6.6
  • pyarrow ==0.17.1
  • python-dateutil ==2.7.2
  • pytz ==2018.4
  • scikit-learn ==0.23.2
  • scipy ==1.5.2
  • seaborn ==0.8.1
  • tabulate ==0.8.2
src/interface_py/requirements_test.txt pypi
  • pylint ==2.4.4 test
  • pytest ==3.10.1 test
  • pytest-cov ==2.5.1 test
  • pytest-forked ==0.2 test
  • pytest-timeout ==1.3.3 test
  • pytest-xdist ==1.22.2 test
  • statsmodels ==0.10.1 test
h2o4gpu-docs-theme/Gemfile rubygems
  • compass >= 0
h2o4gpu-docs-theme/Gemfile.lock rubygems
  • chunky_png 1.2.9
  • compass 0.12.2
  • fssm 0.2.10
  • sass 3.2.12
h2o4gpu-docs-theme/setup.py pypi
src/interface_py/setup.py pypi