Why does it take about 200 times longer to run the case code on a personal computer than the time shown on the web case?

(A Primer on Bayesian Methods for Multilevel Modeling,Example: Radon contamination Gelman and Hill [2006])

with pooled_model:
pooled_trace = pm.sample(random_seed=RANDOM_SEED)

web example : Sampling 4 chains for 1_000 tune and 1_000 draw iterations (4_000 + 4_000 draws total) took 4 seconds.

“actually”:Sampling 4 chains for 1_000 tune and 1_000 draw iterations (4_000 + 4_000 draws total) took 728 seconds.

WIN 10, RAM :16.0 GB ,
processor: AMD Ryzen 7 4800H with Radeon Graphics 2.90 GHz

Try updating to the very last version of PyMC, and if it’s still slow setting chains=1 in pm.sample. Does that make a big difference?

Thanks for the comments.
Followed your suggestion, updated Pymc, and set chains =1, but still no change in sampling time.
Do you have any other possible suggestions?

Are you getting any warning when you import PyMC?

What does the following show?

import pymc
print(pymc.__version__)
import pytensor
print(pytensor.__version__)
print(pytensor.config.config.blas__ldflags)
1 Like

Thanks for your help, there were some warnings I ignored.
After installing “m2w64-toolchain”, the sampling calculation speed is normal.

4 Likes

Glad you fixed your issue. As always, it it recommended to following the installation procedures found here (edit: …which should ensure that you have all relevant dependencies installed alongside PyMC).

1 Like