Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
261c59b
python C extension
sinanshi Apr 23, 2015
4641ce6
establish gpu folder; Makefile; python ctype; (scratch)
sinanshi Apr 27, 2015
e543e3f
update the structure of the code and add one dummy global function cdist
sinanshi Apr 29, 2015
b5142b7
add matrix vector element wise multiplication
sinanshi Apr 30, 2015
2d80a3e
update header file
sinanshi Apr 30, 2015
71c5080
gpu_cdist() ready, but not verified
sinanshi Apr 30, 2015
ac83b4e
computeTranspose; matrix vector multiplication; some tests for debug;…
sinanshi May 4, 2015
fdac4a5
cdist 3D
sinanshi May 4, 2015
e7e7422
gpu exp function
sinanshi May 4, 2015
fe567ef
cunit test scaffolding
sinanshi May 5, 2015
3f38212
tests of gpu vector times matrix
sinanshi May 6, 2015
a565a03
tests of cdist()
sinanshi May 6, 2015
14808d1
test of matrixExp
sinanshi May 7, 2015
1f9883d
remove debug
sinanshi May 7, 2015
aca9572
add cublasgemm tests
sinanshi May 9, 2015
72b779d
to compute var
sinanshi May 11, 2015
4b86d64
compute derivative
sinanshi May 11, 2015
a0bbb92
add output vectors to predict function
sinanshi May 12, 2015
6fe7d98
working version 1
sinanshi May 15, 2015
c783529
first scratch cmake
sinanshi May 18, 2015
2569497
adaptation to capability 2.0
sinanshi May 22, 2015
a42ee6f
new cmake with cookoff
sinanshi May 22, 2015
edc39e9
change cookoff file name
sinanshi May 22, 2015
24a2eb6
1) adding loop in the kernels avoiding threads number exceeding. 2) b…
sinanshi May 22, 2015
ea03cc4
Merge branch 'master' of https://github.com/UCL/gp_emulator
sinanshi May 22, 2015
e24347c
loop implementation
sinanshi May 24, 2015
a0fb1ee
solve conflict
sinanshi May 24, 2015
44eb74c
single precision
sinanshi May 26, 2015
2d1466b
add cmake cookoff file
sinanshi May 26, 2015
4ab4c67
N=1.8e6, blocksize=7
sinanshi May 26, 2015
1aceb25
top level layout
sinanshi May 26, 2015
ccba736
cmake top level
sinanshi May 26, 2015
7596569
cmake for testings;
sinanshi May 26, 2015
bb49bac
tests called by python; single precision implementation
sinanshi May 27, 2015
d9a9bef
fix the bug of cublasgemm
sinanshi May 27, 2015
cc23028
cmake
sinanshi May 27, 2015
645c305
nvcc configure
sinanshi Jun 1, 2015
6f7c5d5
cmake configured on Legion
sinanshi Jun 2, 2015
c609126
add correct python library
sinanshi Jun 2, 2015
fb6b6a7
reset unit testing path
sinanshi Jun 2, 2015
570e509
tidyup; remove cdist function redundent argument D
sinanshi Jun 2, 2015
515f626
commenting; modify cmake file
sinanshi Jun 3, 2015
d8989fa
free the memory properly
sinanshi Jun 3, 2015
a96aac2
benchmark tidy up
sinanshi Jun 3, 2015
50f6264
add comments
sinanshi Jun 3, 2015
c11d17d
add output arguments to predict function; change computeTranspose
sinanshi Jun 4, 2015
b94a9ee
tidyup
sinanshi Jun 5, 2015
1585f37
cope with python setup
sinanshi Jun 5, 2015
2c48f02
change cmake directory
sinanshi Jun 8, 2015
e99ca3f
transfer back mu, var, deriv back to original python, error is around…
sinanshi Jun 8, 2015
66160ef
is_gpu
sinanshi Jun 8, 2015
38ebd91
test_perband
sinanshi Jun 8, 2015
0481e2b
fix the bug of python calling C failure: input data has to be in 1 di…
sinanshi Jun 9, 2015
c1dd055
tidyup, unit_tests2
sinanshi Jun 9, 2015
8612b1b
add comments
sinanshi Jun 9, 2015
093fa1f
truncate input data
sinanshi Jun 10, 2015
f357cb5
remove redundent class GP and calling from GaussianProcess directely
sinanshi Jun 10, 2015
a49dd95
float and double precision check
sinanshi Jun 10, 2015
4c7ee32
better truncate overcome the issue of last block being too small
sinanshi Jun 10, 2015
d463a40
tidyup
sinanshi Jun 12, 2015
14ef519
kernel_vectorTimesMatrix
sinanshi Jun 12, 2015
5433f21
remove benchmark2
sinanshi Jun 15, 2015
5cc6033
add init_array, cdist kernel
sinanshi Jun 15, 2015
af07af9
add matrixExp
sinanshi Jun 15, 2015
72e632f
add kernel: crossminux, elementwiseMult, matrixExp, rowSum, scalarMin…
sinanshi Jun 15, 2015
f2b20ac
modify python tests
sinanshi Jun 15, 2015
b35f1a9
correct type error of pow
sinanshi Jun 15, 2015
3b4f651
remove matplotlib
sinanshi Jun 16, 2015
1dc55fd
temproary remove matplotlib in multivariate
sinanshi Jun 16, 2015
d95f3d4
fix the bug of deriv
sinanshi Jun 16, 2015
0d47196
tidy up; remove error message of predict
sinanshi Jun 16, 2015
8f86055
tidyup
sinanshi Jun 16, 2015
fca0d0b
tidyup
sinanshi Jun 16, 2015
16711db
tidyup
sinanshi Jun 16, 2015
b7c09ab
compare_result
sinanshi Jun 16, 2015
7b31a93
tidyup
sinanshi Jun 16, 2015
119b694
tidyup
sinanshi Jun 17, 2015
03117f1
Update README.rst
sinanshi Jun 17, 2015
c478507
readme
sinanshi Jun 17, 2015
91504d7
format readme
sinanshi Jun 17, 2015
5f33dce
remove comments
sinanshi Jun 17, 2015
ff313dc
calling cmake via setup.py
sinanshi Jun 17, 2015
0f2aa7e
setup include .so file
sinanshi Jun 20, 2015
1491812
change prec to precision
sinanshi Jun 20, 2015
8ebc3d6
change variable name
sinanshi Jun 21, 2015
f5586df
remove __main__
sinanshi Jun 21, 2015
7f39469
modify get_gpu_block, add comments
sinanshi Jun 21, 2015
7b5baca
change variable name
sinanshi Jun 21, 2015
1a33679
better variable names predict.cu
sinanshi Jun 21, 2015
248af97
breakdown distance calculation
sinanshi Jun 21, 2015
3bf91cd
break down predict.cu blocks into functions
sinanshi Jun 21, 2015
daf90f9
correcting the error that compute_error is not called in last version
sinanshi Jun 21, 2015
eb4f09b
tidy up, change variable names, change macro to inline functions
sinanshi Jun 22, 2015
775dfb7
char float64 to function np.float64
sinanshi Jun 22, 2015
05858b4
c++ implementation of predict function
sinanshi Jun 24, 2015
06a6931
finish c++ implementation header file
sinanshi Jun 24, 2015
c701bcf
tidyup
sinanshi Jun 24, 2015
decbaf0
reduce unit test iterations
sinanshi Jun 24, 2015
25bbed1
free_gpu()
sinanshi Jun 24, 2015
df574fd
setup test
sinanshi Jun 24, 2015
d95dd9f
refactoring tests
sinanshi Jun 25, 2015
a7fa427
cpp -> cu
sinanshi Jun 25, 2015
16924bd
remove _gpu_predict.c
sinanshi Jun 25, 2015
aa5ce51
setup benchmark and test
sinanshi Jun 25, 2015
579e78b
Update README.rst
sinanshi Jun 25, 2015
b330d1f
fix setup.py benchmark
sinanshi Jun 25, 2015
a15e8f3
modifications for legion compilers, error_t has already been defined.
sinanshi Jun 25, 2015
787fce0
deviceQuery for jenkins testing only
sinanshi Jun 25, 2015
dfaf578
traspose: ld_in -> lead_dim_in, etc.
sinanshi Jun 25, 2015
313fa5d
change variables' name of kernels
sinanshi Jun 25, 2015
902f85b
Merge branch 'master' of https://github.com/UCL/gp_emulator
sinanshi Jun 25, 2015
c0fb98a
remove print debug for cdist and crossmius
sinanshi Jun 25, 2015
b829ac0
tidy up
sinanshi Jun 25, 2015
ce5317b
correct typo
sinanshi Jun 25, 2015
c32e28c
typo
sinanshi Jun 26, 2015
f8ebde4
benchmark2: timing cpu times by operations
sinanshi Jul 1, 2015
92f3460
print out properly
sinanshi Jul 1, 2015
227276a
report
sinanshi Jul 6, 2015
4f1fcd1
modification of report
sinanshi Jul 8, 2015
5dddc08
restructuring cmake files, make double precision as an option
sinanshi Oct 21, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cmake_minimum_required (VERSION 2.8)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Sinan, this is an example comment.

include(cmake/LookUp-GreatCMakeCookOff.cmake)
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/lib)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/tests)
string(ASCII 27 Esc)

option(double "Enable testing" off)

if(double)
add_definitions(-DDOUBLE__PRECISION)
endif()


set(ColourReset "${Esc}[m")
set(Red "${Esc}[1;31m")
message("${Red}export PYTHONPATH=$PYTHONPATH:${LIBRARY_OUTPUT_PATH} ${ColourReset}")

find_package(Numpy REQUIRED)
find_package(CoherentPython REQUIRED)
find_package(CUDA QUIET REQUIRED)

find_library(FOUND_CUBLAS cublas)
include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${NUMPY_INCLUDE_DIRS}/numpy)

set(CUBLAS_TARGET_LINK ${FOUND_CUBLAS})

subdirs(gp_emulator/gpu)
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include setup.py README.rst
recursive-include gp_emulator/GaussianProcess.py __init__.py lhd.py multivariate_gp.py save_emulators.py
#recursive-include gp_emulator/ GaussianProcess.py __init__.py lhd.py multivariate_gp.py save_emulators.py
#include build/lib/_gpu_predict.so
36 changes: 33 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,38 @@ GP emulators

This repository contains an implementation of GPs for emulation in Python. Although many different implementations exist, this particular one deals with fast GP predictions for large number of input vectors, where the training data sets are typically modest (e.g. less than 300 samples). Access to the emulation's partial derivatives and Hessian matrix is calculated, and training is also taken care of.

You can install with
Requirements:
---------
* python ( 2.7 or later )
* numpy
* scipy
* GPU predict module:
* cmake
* CUDA 5.0 or later
* CUnit

python setup.py install
Install with GPU predict:
---------
1. decide precision by modifying CMakeList.txt
`add_definition(-DDOUBLE_PRECISION) # double`
2. install
`python setup.py install`

Tests (for GPU predict):
----------

The only requirements are (if memory serves) numpy and scipy.
test: `python setup.py test`

benchmark:`python setup.py benchmark`

1. Unit testing ([unit_tests.py](https://github.com/UCL/gp_emulator/blob/master/tests/unit_tests.py)):
* random inputs generated by python predict
* operate unit testings of GPU functions.
* compare GPU and python outputs
2. benchmark [benchmark.py](https://github.com/UCL/gp_emulator/blob/master/tests/benchmark.py)
* obtain speedup of GPU predict
* random inputs
3. testing emulator ([testing_emulator.py](https://github.com/UCL/gp_emulator/blob/master/tests/test_perband_emulator.py))
* read real data from .zpn file
* run emulator with and without GPU

4 changes: 4 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
59 changes: 59 additions & 0 deletions cmake/LookUp-GreatCMakeCookOff.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This file is part of the GreatCMakeCookOff package and distributed under the MIT Licences.
# Upon inclusion in a cmake file, it will download the GreatCMakeCookOff and make itself known to
# CMake. It should be added explicitely to build systems that make use of recipes from the cook-off.
# And it should be included prior to using cook-off recipes:
#
# ```{CMake}
# include(LookUp-GreatCMakeCookOff)
# ```


# First attempts to find the package
set(COOKOFF_DOWNLOAD_DIR "${PROJECT_BINARY_DIR}/external/src/GreatCMakeCookOff")
find_package(GreatCMakeCookOff NO_MODULE PATHS "${COOKOFF_DOWNLOAD_DIR}" QUIET)

# Otherwise attempts to download it.
# Does not use ExternalProject_Add to avoid doing a recursive cmake step.
if(NOT GreatCMakeCookOff_FOUND)
message(STATUS "[GreatCMakeCookOff] not found. Will attempt to clone it.")

# Need git for cloning.
find_package(Git)
if(NOT GIT_FOUND)
message(FATAL_ERROR "[Git] not found. Cannot download GreatCMakeCookOff")
endif()

# Remove GreatCMakeCookOff directory if it exists
if(EXISTS "${COOKOFF_DOWNLOAD_DIR}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E remove_directory "${COOKOFF_DOWNLOAD_DIR}"
OUTPUT_QUIET
)
endif()
if(NOT COOKOFF_GITREPO)
set(COOKOFF_GITREPO https://github.com/UCL/GreatCMakeCookOff.git)
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} clone "${COOKOFF_GITREPO}"
"${COOKOFF_DOWNLOAD_DIR}"
RESULT_VARIABLE CLONING_COOKOFF
OUTPUT_QUIET
ERROR_VARIABLE CLONING_ERROR
)

if(NOT ${CLONING_COOKOFF} EQUAL 0)
message(STATUS "${CLONING_ERROR}")
message(FATAL_ERROR "[GreatCMakeCookOff] git cloning failed.")
else()
message(STATUS "[GreatCMakeCookOff] downloaded to ${COOKOFF_DOWNLOAD_DIR}")
find_package(GreatCMakeCookOff NO_MODULE PATHS "${COOKOFF_DOWNLOAD_DIR}" QUIET)
endif()

set(GreatCMakeCookOff_DIR "${COOKOFF_DOWNLOAD_DIR}/cmake")
set(GreatCMakeCookOff_FOUND TRUE)
endif()
unset(COOKOFF_DOWNLOAD_DIR)

# Adds GreatCMakeCookOff to module paths
initialize_cookoff()

4 changes: 4 additions & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
Binary file added doc/Gomez_Lewis.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions doc/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pandoc report.md -o report.pdf -H report.latex
Binary file added doc/kernel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions doc/report.latex
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
\let\oldlongtable\longtable
\def\longtable{\tiny \oldlongtable}
\usepackage[svgnames]{xcolor}
\usepackage{libertine}
\usepackage{framed}
\let\oldquote\quote
\let\endoldquote\endquote
\definecolor{verypalegreen}{RGB}{252,255,250}
\colorlet{shadecolor}{verypalegreen}

\makeatletter
\def\shadequote{\begin{snugshade}\begin{oldquote}}
\def\endshadequote{%
\end{oldquote}\end{snugshade}}
\makeatother
\renewenvironment{quote}{\begin{shadequote}}{\end{shadequote}}
\usepackage{lettrine} % Package to accentuate the first letter of the text
\usepackage{fix-cm} % Custom font sizes - used for the initial letter in the document

\definecolor{uclmidgreen}{RGB}{130,141,55}

\newcommand{\initial}[1]{ % Defines the command and style for the first letter
\lettrine[lines=3,lhang=0.3,nindent=0em]{
\color{DarkGreen}
{\textsf{#1}}}{}}

\usepackage{sectsty} % Enables custom section titles
\sectionfont{\color{uclmidgreen} \usefont{OT1}{phv}{b}{n}} % Change the font of all section commands
\subsectionfont{\color{DarkSeaGreen} \usefont{OT1}{phv}{b}{n}} % Change the font of all section commands

\usepackage{titling} % Allows custom title configuration
\newcommand{\HorRule}{\color{DarkSeaGreen} \rule{\linewidth}{1pt}} % Defines the gold horizontal rule around the title

\pretitle{
\vspace{-30pt} \begin{flushleft} \HorRule \fontsize{38}{38} \usefont{OT1}{phv}{b}{n} \color{uclmidgreen} \selectfont} % Horizontal rule before the title

\posttitle{\par\end{flushleft}\begin{flushleft}\fontsize{25}{25} \usefont{OT1}{phv}{b}{n} \color{Black} GPU acceleration of Gaussian process emulator\selectfont \end{flushleft}\vskip 0.5em } % Whitespace under the title and subtitle

\preauthor{\begin{flushleft}\large \lineskip 0.5em \usefont{OT1}{phv}{b}{sl} \color{uclmidgreen} Sinan Shi}% Author font configuration

\postauthor{\footnotesize \usefont{OT1}{phv}{m}{sl} \color{Black} % Configuration for the institution name


University College London% Your institution

\par\end{flushleft}\HorRule} % Horizontal rule after the title

\hypersetup{linkcolor=black}
Loading