ImperialCollegeLondon / crim

UROP summer 2020 on statistical machine learning and criminology
MIT License
1 stars 2 forks source link

Install hpHawkes and benchmark MCMC #4

Open andrewjholbrook opened 4 years ago

andrewjholbrook commented 4 years ago

hpHawkes is located at github repo https://github.com/suchard-group/hawkes.

Clone the repo and follow the directions under the R package heading here https://github.com/suchard-group/hawkes#hphawkes-high-performance-hawkes-process-library.

To get working on a GPU, you might need to install OpenCL drivers (https://github.com/suchard-group/hawkes#opencl).

Report MCMC runtimes for different numbers of CPU cores, SIMD arrangements (none, SSE, AVX) and different GPUs. Be careful, not all GPUs support double precision floating point operations.

flaxter commented 4 years ago

Here's a fork for us to use: https://github.com/ImperialCollegeLondon/hawkes

Our first goal should be to commit code here that'll allow us to run this on HPC RCS: https://www.imperial.ac.uk/admin-services/ict/self-service/research-support/rcs/

flaxter commented 4 years ago

@andrewjholbrook what goes wrong if the GPU doesn't support double precision floating point?

andrewjholbrook commented 4 years ago

Error in hpHawkes::createEngine(embeddingDimension = P, locationCount = N, : Build Program Failure

`4. stop(structure(list(message = "Build Program Failure", call = hpHawkes::createEngine(embeddingDimension = P, locationCount = N, tbb = threads, simd = simd, gpu = gpu, single = single), cppstack = NULL), class = c("boost::wrapexcept", "C++Error", "error", "condition"))) at RcppExports.R#23

3. hpHawkes::createEngine(embeddingDimension = P, locationCount = N, tbb = threads, simd = simd, gpu = gpu, single = single) at Untitled.R#203

2. engineInitial(locations, N, P, times, params, threads, simd, gpu, single) at Untitled.R#312

1. sampler(n_iter = Max, burnIn = burn, locations = X, params = c(10, 0.5, 0.3, 0.2857143, 0.05, 1), times = times, gpu = 1, radius = 2) `

flaxter commented 4 years ago

I meant at a more fundamental level---does the entire method fall apart without double precision floating point? Is there a way to get it to work if necessary / useful?

andrewjholbrook commented 4 years ago

Got it, sorry. The method does not necessarily fall apart without double precision, but one has no guarantees as to accuracy. In practice, I have produced similar results with single precision, i.e. single=1.

xiangyu60 commented 4 years ago

I think I want to choose this task! Thanks

Yushi-Y commented 4 years ago

I want to work on this task too and have created the channel for it.

andrewjholbrook commented 4 years ago

@CoderCharlize To answer your question about code that implements MCMC for the background rates (in addition to all other parameters), you need to build the hpHawkes library from branch modified_bg_rate (@flaxter not sure how you want to handle this since you forked the master branch). Then you can look at the sample R script gun_shootings_multicity/code/mcmc/fully_bayes_run.R.

flaxter commented 4 years ago

good git / github question! @CoderCharlize please investigate and let me know if I need to do anything--I can make you an admin for the fork if it helps

On Wed, Jul 1, 2020 at 9:38 PM andrewjholbrook notifications@github.com wrote:

@CoderCharlize https://github.com/CoderCharlize To answer your question about code that implements MCMC for the background rates (in addition to all other parameters), you need to build the hpHawkes library from branch modified_bg_rate (@flaxter https://github.com/flaxter not sure how you want to handle this since you forked the master branch). Then you can look at the sample R script gun_shootings_multicity/code/mcmc/fully_bayes_run.R.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ImperialCollegeLondon/crim/issues/4#issuecomment-652634769, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOPWZHYWGAC32QLV6V7X3RZONFVANCNFSM4OKT2AEA .

xiangyu60 commented 4 years ago

Can I ask what question did CoderCharlize ask? Thanks!

andrewjholbrook commented 4 years ago

@CoderCharlize would you mind answering @xiangyu60 's question? It might be helpful to refer to Section 2.1 of our recent paper located here: https://arxiv.org/abs/2005.10123.

There's also these two MCMC traceplots (attached) philadelphia_incidents_2016-2018_with_holidays

FB_lowerbounds_1km_1week_philly_incidents_2016-2018_with_holidays

Yushi-Y commented 4 years ago

Thank you @andrewjholbrook and I will try to explain to @xiangyu60