Code Monkey home page Code Monkey logo

stan_gpu_install_docs's Introduction

Stan parallel computation framework

This repository is a temporary location for the installation instructions (with example) for the parallel computation framework for the Stan software for Bayesian inference.

The framework has been integrated with Stan code, which can be found at stan-dev, in particular, in Stan and Stan Math library.

Information on functions (and signatures) that have parallel computation support can also be found in the Stan language functions reference.

We maintain an up-to-date description of the framework and implementation details for some of the GPU-optimized algorithms in this arXiv paper.

GPU support installation instructions for CmdStan, the shell interface to Stan, can be found here.

GPU support installation instructions for CmdStanR, a lightweight interface to Stan for R users, can be found here.

stan_gpu_install_docs's People

Contributors

estrumbelj avatar rok-cesnovar avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stan_gpu_install_docs's Issues

Error when compiling model on Windows following cmdstanR instructions

Hello - first off, apologies if this isn't the appropriate place to post this. Second, please let me know if you need more information.

I'm attempting to enable GPU support when using cmdstan. I work mainly in R, so I'm using cmdstanr. I cloned this repo, followed the install instructions and tried running the code in lr_glm_cmdstan.R, but have run into some errors.

First, when I run the code as is I get the error when I reach line 12:

mod <- cmdstan_model(model_path, exe_file = "lr_glm_opencl", cpp_options = opencl_options, quiet = FALSE)
Error in self$compile(...) : unused argument (exe_file = "lr_glm_opencl")

I removed that argument and attempted running line 12 again. This is the output I get when I attempt that.

> mod <- cmdstan_model(model_path, cpp_options = opencl_options, quiet = FALSE)
Compiling Stan program...
Running mingw32-make.exe "C:/Users/MANDEL~1/AppData/Local/Temp/RtmpSgOOMq/model-206030b38d4.exe" \
  "STAN_OPENCL=TRUE OPENCL_PLATFORM_ID=0 OPENCL_DEVICE_ID=0" "STANCFLAGS += --use-opencl --name='lr_glm_model'"

--- Compiling pre-compiled header. This might take a few seconds. ---
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes   -I stan/lib/stan_math/lib/opencl_2.2.0   -I stan/lib/stan_math/lib/tbb_2019_U8/include   -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.7 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS  -DSTAN_OPENCL -DOPENCL_DEVICE_ID=0 -DOPENCL_PLATFORM_ID=0 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -Wno-ignored-attributes      -c stan/src/stan/model/model_header.hpp -o stan/src/stan/model/model_header_opencl.hpp.gch
In file included from stan/src/stan/model/model_header.hpp:16:
stan/src/stan/services/util/create_rng.hpp:35:1: internal compiler error: in gt_pch_note_object, at ggc-common.c:276
 }  // namespace stan
 ^
In file included from stan/src/stan/model/model_header.hpp:16:
stan/src/stan/services/util/create_rng.hpp:35:1: internal compiler error: in gt_pch_note_object, at ggc-common.c:276
 }  // namespace stan
 ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/r-windows> for instructions.
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/r-windows> for instructions.
mingw32-make.exe: *** [make/program:25: stan/src/stan/model/model_header_opencl.hpp.gch] Error 1
mingw32-make.exe: *** [make/program:25: stan/src/stan/model/model_header_opencl.hpp.gch] Error 1
Error: An error occured during compilation! See the message above for more information.

The model does compile and I'm able to fit it if I remove cpp_options = opencl_options.
I am able to fit other models just fine and am able to use brms and set the backend to cmdstan.

Here is my session info. I'm using cmdstan verserion 2.25.0

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] cmdstanr_0.1.3

loaded via a namespace (and not attached):
 [1] pillar_1.4.7     compiler_4.0.3   tools_4.0.3      bit_4.0.4        jsonlite_1.7.1   lifecycle_0.2.0 
 [7] tibble_3.0.4     gtable_0.3.0     checkmate_2.0.0  pkgconfig_2.0.3  rlang_0.4.8      cli_2.2.0       
[13] rstudioapi_0.13  parallel_4.0.3   xfun_0.19        dplyr_1.0.2      generics_0.1.0   vctrs_0.3.4     
[19] rprojroot_2.0.2  bit64_4.0.5      grid_4.0.3       tidyselect_1.1.0 glue_1.4.2       here_1.0.0      
[25] R6_2.5.0         processx_3.4.5   fansi_0.4.1      vroom_1.3.2      ggplot2_3.3.2    purrr_0.3.4     
[31] posterior_0.1.2  magrittr_2.0.1   backports_1.1.10 scales_1.1.1     ps_1.4.0         ellipsis_0.3.1  
[37] abind_1.4-5      assertthat_0.2.1 colorspace_1.4-1 utf8_1.1.4       tinytex_0.27     munsell_0.5.0   
[43] crayon_1.3.4  

EC2 instance

It might be too soon for such a question but have you made this work on an AWS EC2 instance?
If yes, how?

Thank you in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.