Skip to content

Commit

Permalink
Rel 6.2.0 - Make Julia level threads default again
Browse files Browse the repository at this point in the history
  • Loading branch information
goedman committed Feb 10, 2022
1 parent dc9a7ff commit 3cf3ccf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,13 @@ Stan.jl v9.0 uses StanSample.jl v6, StanOptimize.jl v4, StanQuap.jl v4, StanDiag

## Requirements

Stan's cmdstan executable needs to be installed separatedly. Please see [cmdstan installation](https://stanjulia.github.io/Stan.jl/latest/INSTALLATION/).
Stan's cmdstan executable needs to be installed separatedly. Please see [cmdstan installation](https://stanjulia.github.io/Stan.jl/latest/INSTALLATION/). If you plan to use C++ level threads, please read the `make/local-example` instructions.

StanSample.jl v6 uses c++ multithreading in the `cmdstan` binary and requires cmdstan v2.28.2 and up. To activate multithreading in `cmdstan` this needs to be specified during the build process of `cmdstan`. I typically create a `path_to_cmdstan_directory/make/local` file (before running `make -j9 build`) containing `STAN_THREADS=true`.
StanSample.jl v6 enables c++ multithreading in the `cmdstan` binary and requires cmdstan v2.28.2 and up. To activate multithreading in `cmdstan` this needs to be specified during the build process of `cmdstan`. I typically create a `path_to_cmdstan_directory/make/local` file (before running `make -j9 build`) containing `STAN_THREADS=true`.

This means StanSample now supports 2 mechanisms for in paralel drawing samples for chains, i.e. on C++ level (using threads) and on Julia level (by spawing a Julia process for each chain).

The `use_cpp_chains` keyword argument for `stan_sampe()` determines if chains are executed on C++ level or on Julia level. By default, `use_cpp_chains=true`.

If your build of cmdstan does not support C++ threads or you prefer to use Julia level chains, specify:
```
rc = stan_sample(model; use_cpp_chains=false, [data | init | ...])
```
The `use_cpp_chains` keyword argument for `stan_sampe()` determines if chains are executed on C++ level or on Julia level. By default, `use_cpp_chains=false`.

By default in ether case `num_chains=4`. See `??stan_sample`. Internally, `num_chains` will be copied to either `num_cpp_chains` or `num_julia_chains'.`

Expand Down Expand Up @@ -72,6 +67,15 @@ Set the CMDSTAN environment variable so that Julia can find the cmdstan installa

## Versions

### Version 9.2.1 (soon)

1. Switch to cmdstan-2.29.0

### Version 9.2.0

1. Switched from JSON3.jl to JSON.jl (JSON.jl supports 2D arrays)
2. Switched back to by default using Julia level chains.

### Version 9.1.1

1. Documentation improvement.
Expand Down
7 changes: 1 addition & 6 deletions docs/src/INTRO.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ StanSample.jl v6 uses c++ multithreading in the `cmdstan` binary and requires cm

This means StanSample now supports 2 mechanisms for in paralel drawing samples for chains, i.e. on C++ level (using threads) and on Julia level (by spawing a Julia process for each chain).

The `use_cpp_chains` keyword argument for `stan_sampe()` determines if chains are executed on C++ level or on Julia level. By default, `use_cpp_chains=true`.

If your build of cmdstan does not support C++ threads or you prefer to use Julia level chains, specify:
```
rc = stan_sample(model; use_cpp_chains=false, [data | init | ...])
```
The `use_cpp_chains` keyword argument for `stan_sampe()` determines if chains are executed on C++ level or on Julia level. By default, `use_cpp_chains=false`.

By default in ether case `num_chains=4`. See `??stan_sample`. Internally, `num_chains` will be copied to either `num_cpp_chains` or `num_julia_chains'.`

Expand Down
9 changes: 9 additions & 0 deletions docs/src/VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ This version of the package has primarily been tested with GitHub workflows and

## Versions

### Version 9.3.0

1. Switch to cmdstan-2.29.0 for CI testing.

### Version 9.2.0

1. Switch back to Julia level chains as default.
2. Replace JSON3.jl by JSON.jl (support for 2D arrays).

### Version 9.1.1

1. Documentation improvement.
Expand Down

0 comments on commit 3cf3ccf

Please sign in to comment.