Hello community, I’m having a PyMC model which I want to train on a Macbook with M1 Pro processor. I’m seeing a serious performance crisis while training.
We tried to benchmark the training performance across different system configurations:
I’ve have ensured there isn’t inconsistency issues in benchmarking, since I’m using the same version controlled bash script which triggers the PyMC model training script.
Do I need to do some additional configuration before training the model on Macbook M1 Pro chip?
Make sure you have the latest pytensor (pip install -U pytensor) and probably does not hurt to delete your ~/.pytensor directory. The only other thing I can think of is that you are using a Python running under Rosetta, rather than natively under M1? You can also run using the Numpyro sampler (nuts_sampler="numpyro"), which will almost always be faster.
Thanks @fonnesbeck and @cluhmann , I did the following and the model trained in 13.5 minutes:
Installed miniforge - brew install --cask miniforge. Following this question and the first answer.
Then created a new conda environment refering to pymc documentation , using python 3.10 and pymc5.7 - conda create -c conda-forge -n pymc_env python=3.10 pymc==5.7
Activated the conda environment conda activate pymc_env
Installed other packages using pip - pip install -r requirements.txt . In requirements.txt though, I removed pymc, pandas and request, which were already installed in the conda environment when I checked using conda list -n pymc_env. Note: I tried installing these packages using conda first, but it showed conflicts while installing, so switched to pip.