Skip to content

Commit

Permalink
Validation dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
mdymczyk committed Jun 1, 2018
1 parent 94265db commit 3990da8
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile-build
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ ENV GIT_AUTHOR_NAME="anonymous"
ENV GIT_AUTHOR_EMAIL="[email protected]"
ENV GIT_COMMITTER_NAME="anonymous"
ENV GIT_COMMITTER_EMAIL="[email protected]"
ENV EMAIL="[email protected]"
ENV EMAIL="[email protected]"
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ run_in_docker-cpu:
#########################################
# TARGETS INSTALLING LIBRARIES
#########################################

# http://developer2.download.nvidia.com/compute/cuda/9.0/secure/rc/docs/sidebar/CUDA_Quick_Start_Guide.pdf?_ZyOB0PlGZzBUluXp3FtoWC-LMsTsc5H6SxIaU0i9pGNyWzZCgE-mhnAg2m66Nc3WMDvxWvvQWsXGMqr1hUliGOZvoothMTVnDe12dQQgxwS4Asjoz8XiOvPYOjV6yVQtkFhvDztUlJbNSD4srPWUU2-XegCRFII8_FIpxXERaWV
libcuda9:
# wget https://developer.nvidia.com/compute/cuda/9.0/rc/local_installers/cuda-repo-ubuntu1604-9-0-local-rc_9.0.103-1_amd64-deb
Expand Down
16 changes: 16 additions & 0 deletions ci/Jenkinsfile.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<<<<<<< Updated upstream:ci/Jenkinsfile.template
=======
// Just Notes:
//
//def jobnums = [0 , 1 , 2 , 3]
//def tags = ["nccl" , "nonccl" , "nccl" , "nonccl"]
//def cudatags = ["cuda8", "cuda8" , "cuda9" , "cuda9"]
//def dobuilds = [1, 0, 0, 0]
//def dofulltests = [1, 0, 0, 0]
//def dopytests = [1, 0, 0, 0]
//def doruntimes = [1, 1, 1, 1]
//def dockerimagesbuild = ["nvidia/cuda:8.0-cudnn5-devel-centos7", "nvidia/cuda:8.0-cudnn5-devel-centos7", "nvidia/cuda:9.0-cudnn7-devel-centos7", "nvidia/cuda:9.0-cudnn7-devel-centos7"]
//def dockerimagesruntime = ["nvidia/cuda:8.0-cudnn5-runtime-centos7", "nvidia/cuda:8.0-cudnn5-runtime-centos7", "nvidia/cuda:9.0-cudnn7-runtime-centos7", "nvidia/cuda:9.0-cudnn7-runtime-centos7"]
//def dists = ["dist1","dist2","dist3","dist4"]

>>>>>>> Stashed changes:Jenkinsfile.utils2
def benchmark_commit_trigger

pipeline {
Expand Down
2 changes: 1 addition & 1 deletion src/base/ffm/ffm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FFM<T>::FFM(Params & params, T *weights) : params(params), trainer(weights, para

template<typename T>
void FFM<T>::fit(const Dataset<T> &dataset, const Dataset<T> &valid_dataset) {
this->trainer.setDataset(dataset);
this->trainer.setTrainingDataset(dataset);
this->trainer.setValidationDataset(valid_dataset);

Timer timer;
Expand Down
3 changes: 2 additions & 1 deletion src/base/ffm/trainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class Trainer {
Trainer(const T *weights, Params &params);
~Trainer();

void setDataset(const Dataset<T> &dataset);
void setTrainingDataset(const Dataset<T> &dataset);
void setValidationDataset(const Dataset<T> &dataset);

T validationLoss();

Expand Down
7 changes: 6 additions & 1 deletion src/cpu/ffm/trainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ Trainer<T>::Trainer(const T* weights, Params &params) : params(params) {
}

template<typename T>
void Trainer<T>::setDataset(const Dataset<T> &dataset) {
void Trainer<T>::setTrainingDataset(const Dataset<T> &dataset) {
// TODO implement
}

template<typename T>
void Trainer<T>::setValidationDataset(const Dataset<T> &dataset) {
// TODO implement
}

Expand Down
9 changes: 8 additions & 1 deletion src/gpu/ffm/trainer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,21 @@ Trainer<T>::Trainer(const T* weights, Params &params) : params(params), trainDat
}

template<typename T>
void Trainer<T>::setDataset(const Dataset<T> &dataset) {
void Trainer<T>::setTrainingDataset(const Dataset<T> &dataset) {
DatasetBatcherGPU<T> *batcher = new DatasetBatcherGPU<T>(dataset, params);
trainDataBatcher[0] = batcher;
}

template<typename T>
void Trainer<T>::setValidationDataset(const Dataset<T> &dataset) {
DatasetBatcherGPU<T> *batcher = new DatasetBatcherGPU<T>(dataset, params);
validationDataBatcher[0] = batcher;
}

template<typename T>
Trainer<T>::~Trainer() {
delete trainDataBatcher[0];
delete validationDataBatcher[0];
delete model;
CUDA_CHECK(cudaDeviceReset());
}
Expand Down
4 changes: 4 additions & 0 deletions src/interface_r/vignettes/getting_started.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ The R package makes use of RStudio's [reticulate](https://rstudio.github.io/reti

## Installation

<<<<<<< Updated upstream
There are a few [system requirements](https://github.com/h2oai/h2o4gpu#requirements), including Linux with glibc 2.17+, Python >=3.6, R >=3.1, CUDA 8 or 9, and a machine with Nvidia GPUs. The code should still run if you have CPUs, but it will fall back to scikit-learn CPU based versions of the algorithms.
=======
There are a few [system requirements](https://github.com/h2oai/h2o4gpu#requirements), including Linux with glibc TODO MATEUSZ what glibc is required??, Python >=3.6, R >=3.1, CUDA 8 or 9, and a machine with Nvidia GPUs. The code should still run if you have CPUs, but it will fall back to scikit-learn CPU based versions of the algorithms.
>>>>>>> Stashed changes
The **h2o4gpu** Python module is a prerequisite for the R package. So first, follow the instructions [here](https://github.com/h2oai/h2o4gpu#user-installation) to install the **h2o4gpu** Python package (either at the system level or in a Python virtual envivonment). The easiest thing to do is to `pip install` the stable release `whl` file. To ensure compatibility, the Python package version number should match the R package version number.

Expand Down
2 changes: 1 addition & 1 deletion src/swig/ch2o4gpu_cpu.i
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
%include "solver/pogs.i"
%include "solver/ffm.i"
%include "matrix/matrix_dense.i"
%include "metrics.i"
%include "metrics.i"

0 comments on commit 3990da8

Please sign in to comment.