# Pymc3 / pymc v4 GPU example for a basic hierarchical model with NUTS sampling

**URL:** <https://discourse.pymc.io/t/pymc3-pymc-v4-gpu-example-for-a-basic-hierarchical-model-with-nuts-sampling/9148>\
**Category:** version agnostic\
**Tags:** gpu\
**Created:** [April 5, 2022, 5:24pm UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-gpu-example-for-a-basic-hierarchical-model-with-nuts-sampling/9148 "2022-04-05T17:24:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vr308](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/vr308/32/2563_2.png) [@vr308](https://discourse.pymc.io/u/vr308)\
**Post date:** [April 5, 2022, 5:24pm UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-gpu-example-for-a-basic-hierarchical-model-with-nuts-sampling/9148/1 "2022-04-05T17:24:48Z")

</div>

Are there any clear-cut instructions anyone can point me to - to run a hierarchical pymc3 model with NUTS on the GPU?

I know that the sampler is on the CPU but I’ve seen that still matrix operations can be deployed on the GPU and in my use case that might offer a significant speed-up.

Alternatively, I might try the pymc v4 + JAX backend option but couldn’t find a clear example for running a basic model on the GPU.

Any pointers to the right material would be appreciated.

---

<div class="post-metadata">

**Author:** ![cluhmann](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/cluhmann/32/3083_2.png) [@cluhmann](https://discourse.pymc.io/u/cluhmann)\
**Post date:** [April 6, 2022, 4:40am UTC](https://discourse.pymc.io/t/pymc3-pymc-v4-gpu-example-for-a-basic-hierarchical-model-with-nuts-sampling/9148/2 "2022-04-06T04:40:11Z")

</div>

Did you find [this post](https://www.pymc-labs.io/blog-posts/pymc-stan-benchmark/)? That seems to be semi-up-to-date (e.g., as mentioned [here](https://discourse.pymc.io/t/pymc3-3-11-0-with-gpu-support/7288/17)).
