Skip to content

Commit df73f8e

Browse files
committed
Improve docs and add threadpoolctl to environments
1 parent 4049c28 commit df73f8e

File tree

7 files changed

+10
-13
lines changed

7 files changed

+10
-13
lines changed

conda-envs/environment-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies:
1818
- networkx
1919
- scipy>=1.4.1
2020
- typing-extensions>=3.7.4
21+
- threadpoolctl>=3.1.0
2122
# Extra dependencies for dev, testing and docs build
2223
- ipython>=7.16
2324
- jax

conda-envs/environment-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies:
1616
- rich>=13.7.1
1717
- scipy>=1.4.1
1818
- typing-extensions>=3.7.4
19+
- threadpoolctl>=3.1.0
1920
# Extra dependencies for docs build
2021
- ipython>=7.16
2122
- jax

conda-envs/environment-jax.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies:
2424
- python-graphviz
2525
- networkx
2626
- rich>=13.7.1
27+
- threadpoolctl>=3.1.0
2728
# JAX is only compatible with Scipy 1.13.0 from >=0.4.26, but the respective version of
2829
# JAXlib is still not on conda: https://github.com/conda-forge/jaxlib-feedstock/pull/243
2930
- scipy>=1.4.1,<1.13.0

conda-envs/environment-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies:
2222
- rich>=13.7.1
2323
- scipy>=1.4.1
2424
- typing-extensions>=3.7.4
25+
- threadpoolctl>=3.1.0
2526
# Extra dependencies for testing
2627
- ipython>=7.16
2728
- pre-commit>=2.8.0

conda-envs/windows-environment-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies:
1919
- rich>=13.7.1
2020
- scipy>=1.4.1
2121
- typing-extensions>=3.7.4
22+
- threadpoolctl>=3.1.0
2223
# Extra dependencies for dev, testing and docs build
2324
- ipython>=7.16
2425
- myst-nb

conda-envs/windows-environment-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies:
2222
- rich>=13.7.1
2323
- scipy>=1.4.1
2424
- typing-extensions>=3.7.4
25+
- threadpoolctl>=3.1.0
2526
# Extra dependencies for testing
2627
- ipython>=7.16
2728
- pre-commit>=2.8.0

pymc/sampling/mcmc.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -505,12 +505,12 @@ def sample(
505505
This requires the chosen sampler to be installed.
506506
All samplers, except "pymc", require the full model to be continuous.
507507
blas_cores: int or "auto" or None, default = "auto"
508-
The total number of threads blas and openmp functions should use during sampling. If set to None,
509-
this will keep the default behavior of whatever blas implementation is used at runtime.
510-
Setting it to "auto" will set it so that the total number of active blas threads is the
508+
The total number of threads blas and openmp functions should use during sampling.
509+
Setting it to "auto" will ensure that the total number of active blas threads is the
511510
same as the `cores` argument. If set to an integer, the sampler will try to use that total
512511
number of blas threads. If `blas_cores` is not divisible by `cores`, it might get rounded
513-
down.
512+
down. If set to None, this will keep the default behavior of whatever blas implementation
513+
is used at runtime.
514514
initvals : optional, dict, array of dict
515515
Dict or list of dicts with initial value strategies to use instead of the defaults from
516516
`Model.initial_values`. The keys should be names of transformed random variables.
@@ -661,15 +661,6 @@ def sample(
661661

662662
cores = min(cores, chains)
663663

664-
if cores < 1:
665-
raise ValueError("`cores` must be larger or equal to one")
666-
667-
if chains < 1:
668-
raise ValueError("`chains` must be larger or equal to one")
669-
670-
if blas_cores is not None and blas_cores < 1:
671-
raise ValueError("`blas_cores` must be larger or equal to one")
672-
673664
num_blas_cores_per_chain: int | None
674665
joined_blas_limiter: Callable[[], Any]
675666

0 commit comments

Comments
 (0)