FROM rocker/tidyverse:3.3.2MAINTAINER James Camac <james...@gmail.com>
RUN apt-get update \ && apt-get install -y --no-install-recommends \ libcurl4-openssl-dev \ texlive-latex-recommended \ texlive-latex-extra \ texlive-humanities \ texlive-fonts-recommended \ texlive-science \ lmodern \ git \ && apt-get clean \ && apt-get autoremove \ && rm -rf var/lib/apt/lists/*
RUN install2.r -r "https://mran.revolutionanalytics.com/snapshot/2016-11-25/" --error \ --deps "TRUE" \ rstan reshape2 cowplot lubridate
RUN installGithub.r \ --deps "TRUE" \ richfitz/remake
RUN rm -rf /tmp/downloaded_packages/ /tmp/*.rds
RUN git clone https://github.com/jscamac/Alpine_Shrub_Experiment /home/Alpine_Shrub_Experimentdocker pull jscamac/rstan_docker_test # Loads docker image
docker run -it jscamac/rstan_docker_test # Runs a docker container that opens R.
# Once in R just run the following:
system.time(remake::make('greaus_seedling_density_model'))
#Using the terminal:
git clone https://github.com/jscamac/Alpine_Shrub_Experiment /home/Alpine_Shrub_Experiment.
#Open R in the repository just downloaded,
installing remake devtools::install_github("richfitz/remake", dependencies=TRUE)
# install any missing packages by running:
remake::install_missing_packages()
#and then run the model using:
system.time(remake::make('greaus_seedling_density_model'))
user system elapsed
16.810 1.310 834.164
Elapsed Time: 347.746 seconds (Warm-up)
298.067 seconds (Sampling)
645.813 seconds (Total)
Elapsed Time: 355.069 seconds (Warm-up)
384.621 seconds (Sampling)
739.69 seconds (Total)
Elapsed Time: 521.517 seconds (Warm-up)
292.196 seconds (Sampling)
813.713 seconds (Total)
user system elapsed
22.487 1.096 116.995
Elapsed Time: 39.6557 seconds (Warm-up)
30.5696 seconds (Sampling)
70.2254 seconds (Total)
Elapsed Time: 39.9883 seconds (Warm-up)
32.2393 seconds (Sampling)
72.2276 seconds (Total)
Elapsed Time: 42.8292 seconds (Warm-up)
44.0682 seconds (Sampling)
86.8974 seconds (Total)
user system elapsed
16.810 1.310 834.164
user system elapsed
22.487 1.096 116.995
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
Perhaps one of the stan team can comment on whether this might indeed make any difference and be worth pursuing further?
R version 3.3.2 (2016-10-31)Platform: x86_64-pc-linux-gnu (64-bit)Running under: Debian GNU/Linux 8 (jessie) R version 3.3.2 (2016-10-31)Platform: x86_64-apple-darwin13.4.0 (64-bit)Running under: OS X 10.11.6 (El Capitan)Sorry I just realised my table didn't compile correctly. So I've edited my previous post and added it as an attachment.
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
# Programming benchmarks (5 tests):
3,500,000 Fibonacci numbers calculation (vector calc): 0.608 (sec).
Grand common divisors of 1,000,000 pairs (recursion): 1.23 (sec).
Creation of a 3500x3500 Hilbert matrix (matrix calc): 0.438 (sec).
Creation of a 3000x3000 Toeplitz matrix (loops): 18.8 (sec).
Escoufier's method on a 60x60 matrix (mixed): 2.67 (sec).
# Matrix calculation benchmarks (5 tests):
Creation, transp., deformation of a 5000x5000 matrix: 1.15 (sec).
2500x2500 normal distributed random matrix ^1000: 0.54 (sec).
Sorting of 7,000,000 random values: 1.11 (sec).
2500x2500 cross-product matrix (b = a' * a): 7.42 (sec).
Linear regr. over a 3000x3000 matrix (c = a \ b'): 4.94 (sec).
# Matrix function benchmarks (5 tests):
Cholesky decomposition of a 3000x3000 matrix: 3.73 (sec).
Determinant of a 2500x2500 random matrix: 2.97 (sec).
Eigenvalues of a 640x640 random matrix: 0.658 (sec).
FFT over 2,500,000 random values: 0.629 (sec).
Inverse of a 1600x1600 random matrix: 2.66 (sec)
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.
Hi Daniel,It isn't running parallel processors. I made sure of that. It is running 4 chains using rstan's default settings (i.e. a single processor). This means the chains run sequentially (i.e. one chain at a time).I have run a single chain example and the same 10-fold difference doesn't change.
I think the bulk of the total time (i.e. system.time() ) is captured by the compiling of the model rather then the run itself. I'm less worried about the compiling times and more worried about the sampling times (i.e. chain times).
Also I have set the same seed for all models (12345).
I'm not sure what benchmark runs you are referring too? The tables are the time results for each chain (total of 4 chains) for each model. Plus the TOTAL which refers to R's system.time() return.
J
Inference for Stan model: 8schools.4 chains, each with iter=2000; warmup=1000; thin=1; post-warmup draws per chain=1000, total post-warmup draws=4000.
mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff Rhatmu 7.95 0.15 5.02 -1.78 4.81 7.76 11.10 17.78 1074 1tau 6.23 0.16 5.38 0.20 2.22 4.87 8.72 20.65 1170 1eta[1] 0.35 0.02 0.95 -1.58 -0.23 0.37 0.99 2.13 2692 1eta[2] 0.01 0.02 0.88 -1.69 -0.58 0.00 0.59 1.74 2650 1eta[3] -0.19 0.02 0.93 -2.01 -0.82 -0.21 0.42 1.64 2805 1eta[4] -0.02 0.02 0.87 -1.73 -0.60 -0.03 0.55 1.69 3127 1eta[5] -0.34 0.02 0.87 -2.00 -0.91 -0.36 0.23 1.39 2699 1eta[6] -0.18 0.02 0.90 -1.94 -0.79 -0.18 0.41 1.62 2557 1eta[7] 0.33 0.02 0.90 -1.44 -0.25 0.33 0.91 2.18 2315 1eta[8] 0.04 0.02 0.96 -1.85 -0.61 0.05 0.67 1.90 2932 1lp__ -39.63 0.07 2.67 -45.59 -41.23 -39.40 -37.76 -35.03 1283 1
Samples were drawn using NUTS(diag_e) at Tue Dec 6 04:56:24 2016.For each parameter, n_eff is a crude measure of effective sample size,and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1).Inference for Stan model: 8schools.4 chains, each with iter=2000; warmup=1000; thin=1; post-warmup draws per chain=1000, total post-warmup draws=4000.
mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff Rhatmu 8.04 0.12 4.92 -1.80 4.87 8.05 11.23 17.97 1682 1.00tau 6.63 0.15 5.65 0.24 2.47 5.27 9.25 20.92 1476 1.01eta[1] 0.38 0.02 0.94 -1.53 -0.25 0.40 1.04 2.12 2823 1.00eta[2] 0.01 0.02 0.87 -1.73 -0.55 0.02 0.59 1.70 2919 1.00eta[3] -0.18 0.02 0.90 -1.93 -0.77 -0.19 0.40 1.65 2776 1.00eta[4] -0.01 0.02 0.83 -1.62 -0.56 -0.02 0.55 1.65 2426 1.00eta[5] -0.33 0.02 0.87 -2.01 -0.90 -0.34 0.23 1.39 2844 1.00eta[6] -0.23 0.02 0.87 -1.95 -0.80 -0.23 0.35 1.51 3293 1.00eta[7] 0.34 0.02 0.84 -1.38 -0.21 0.35 0.89 1.98 2775 1.00eta[8] 0.07 0.02 0.92 -1.73 -0.54 0.09 0.69 1.92 3580 1.00lp__ -39.39 0.10 2.58 -45.21 -40.94 -39.13 -37.53 -35.06 689 1.01
Samples were drawn using NUTS(diag_e) at Tue Dec 6 16:03:27 2016.For each parameter, n_eff is a crude measure of effective sample size,and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1).I didn't run the benchmarks from R. That was Daniel Falster.
On the iMac I'm using -O3 optimisation. I couldn't find the \.R/Makevars on the docker container... interesting.
On the iMac I'm using -O3 optimisation. I couldn't find the \.R/Makevars on the docker container... interesting.
Elapsed Time: 0.019911 seconds (Warm-up) 0.0188 seconds (Sampling) 0.038711 seconds (Total)
Elapsed Time: 0.020201 seconds (Warm-up) 0.015754 seconds (Sampling) 0.035955 seconds (Total)
Elapsed Time: 0.019631 seconds (Warm-up) 0.030389 seconds (Sampling) 0.05002 seconds (Total)
Elapsed Time: 0.020383 seconds (Warm-up) 0.022288 seconds (Sampling) 0.042671 seconds (Total)