# Why does MAP vastly outperform sample in bayesian clustering?

**URL:** <https://discourse.pymc.io/t/why-does-map-vastly-outperform-sample-in-bayesian-clustering/13190>\
**Category:** General\
**Created:** [October 28, 2023, 5:54pm UTC](https://discourse.pymc.io/t/why-does-map-vastly-outperform-sample-in-bayesian-clustering/13190 "2023-10-28T17:54:52Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jessegrabowski](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/jessegrabowski/32/5010_2.png) [@jessegrabowski](https://discourse.pymc.io/u/jessegrabowski)\
**Post date:** [October 31, 2023, 2:07pm UTC](https://discourse.pymc.io/t/why-does-map-vastly-outperform-sample-in-bayesian-clustering/13190/4 "2023-10-31T14:07:48Z")

</div>

I ran the model on a 2021 macbook pro m1, it took about 10 minutes in total (4 minutes ADVI, 6 minutes sampling). JAX took about 4 minutes in total but I got worse traces.

The fact that MvNormal specifically is giving you grief makes me worry about your BLAS installation. If you’re on an M1/M2 mac make sure you’re using [accelerate](https://discourse.pymc.io/t/performance-tip-if-youre-on-arm64-apples-m1-m2-chips-install-accelerate/12495), otherwise make sure you’re using MKL. If you’re on Linux, slow sampling rates on MvNormal models have been reported on Ubuntu: [see here](https://discourse.pymc.io/t/bayesian-var-example-notebook-extremely-low-sampling-rate/12178/4), and the associated issue [here](https://github.com/pymc-devs/pymc-examples/issues/550).

---

_[View the full topic](https://discourse.pymc.io/t/why-does-map-vastly-outperform-sample-in-bayesian-clustering/13190)._
