# Gpu and cpu showing different log prob numbers

**URL:** https://discourse.pymc.io/t/gpu-and-cpu-showing-different-log-prob-numbers/1247
**Category:** Questions
**Tags:** gpu, theano
**Created:** [May 20, 2018, 12:15am UTC](https://discourse.pymc.io/t/gpu-and-cpu-showing-different-log-prob-numbers/1247 "2018-05-20T00:15:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bhomass](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@bhomass](https://discourse.pymc.io/u/bhomass)
#### Post date: [May 20, 2018, 12:15am UTC](https://discourse.pymc.io/t/gpu-and-cpu-showing-different-log-prob-numbers/1247/1 "2018-05-20T00:15:34Z")

</div>

I have a code which I tried running both in cpu and gpu. A typical number for log probability from cpu is  
-66.78053371  
while the gpu numbers are  
-98.88531779

I know there is the difference in double precision for cpu, I can understand if the gpu crashes at certain point due to out of range problems, but how can the same code show such different numbers while its running?

---

<div class="post-metadata">

### Author: ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)
#### Post date: [May 20, 2018, 5:45am UTC](https://discourse.pymc.io/t/gpu-and-cpu-showing-different-log-prob-numbers/1247/2 "2018-05-20T05:45:55Z")

</div>

Wow that is a huge difference. How did you check the logp? is the input `point` identical?

---

<div class="post-metadata">

### Author: ![bhomass](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@bhomass](https://discourse.pymc.io/u/bhomass)
#### Post date: [May 21, 2018, 5:28am UTC](https://discourse.pymc.io/t/gpu-and-cpu-showing-different-log-prob-numbers/1247/3 "2018-05-21T05:28:40Z")

</div>

I have a theory how this happened. I think somewhere along the way, the gpu ran out of precision and started dropping bits. As a result, the end numbers show a ridiculous value. I played with a hyper parameters. Now the numbers match between gpu and cpu.
