pymc-devs/pymc

Only sample using a single thread when sampling multiple chains in parallel

クローズ

#5,453 opened on 2022/02/09

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Python (1,902 件のフォーク)batch import
help wantedrequest discussionv4

Repository metrics

Stars
 (7,926 個のスター)
PR merge metrics
 (平均マージ 11d) (30d で 7 merged PRs)

説明

My prior of what cores=4 does when calling pm.sample() is that pymc would use 4 of my cores. However, because of multi-threading this might not be the case. Furthermore, multi-threading is causing problems when running multiple chains in parallel: https://github.com/pymc-devs/pymc/issues/3140

I thus think we should set os.environ['OMP_NUM_THREADS'] = '1' if we're sampling on > 1 core.

コントリビューターガイド