# Does cmdstan remembers last run?

**URL:** <https://discourse.mc-stan.org/t/does-cmdstan-remembers-last-run/33382>\
**Category:** General\
**Created:** [November 19, 2023, 11:26pm UTC](https://discourse.mc-stan.org/t/does-cmdstan-remembers-last-run/33382 "2023-11-19T23:26:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ezequiel\_Alvarez](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ezequiel_alvarez/32/17362_2.png) [@Ezequiel\_Alvarez](https://discourse.mc-stan.org/u/Ezequiel_Alvarez)\
**Post date:** [November 19, 2023, 11:26pm UTC](https://discourse.mc-stan.org/t/does-cmdstan-remembers-last-run/33382/1 "2023-11-19T23:26:05Z")

</div>

I have completed a run that took 277k seconds (3 days) using cmdstan from command line. After that, I started a run that is exactly equal to the previous one, but just doing a very slight change, and it took 70k seconds (less than a day). Everything else is equal, also the fixed random seed: data is the same data, and also the same sampling seed.

Is it possible that cmdstan remembers some info from the chain path in previous run? Or is it that this such a little change is making such a large change in sampling time?

Thank you! Ezequiel.

---

<div class="post-metadata">

**Author:** ![WardBrian](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/wardbrian/32/12078_2.png) [@WardBrian](https://discourse.mc-stan.org/u/WardBrian)\
**Post date:** [November 20, 2023, 12:13am UTC](https://discourse.mc-stan.org/t/does-cmdstan-remembers-last-run/33382/2 "2023-11-20T00:13:00Z")

</div>

The second run would not have used any information from the first unless you explicitly requested it (e.g., by setting initial values based on the first run’s results)

---

<div class="post-metadata">

**Author:** ![jsocolar](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jsocolar/32/2486_2.png) [@jsocolar](https://discourse.mc-stan.org/u/jsocolar)\
**Post date:** [November 20, 2023, 3:39am UTC](https://discourse.mc-stan.org/t/does-cmdstan-remembers-last-run/33382/3 "2023-11-20T03:39:38Z")

</div>

Note that it’s possible that some or even all of the difference in runtime was stochastic. For example, if the first model run ended up with at least one chain whose adaptation did not yield a good mass matrix, the wall time could be seriously adversely affected.

---

<div class="post-metadata">

**Author:** ![Ezequiel\_Alvarez](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/ezequiel_alvarez/32/17362_2.png) [@Ezequiel\_Alvarez](https://discourse.mc-stan.org/u/Ezequiel_Alvarez)\
**Post date:** [November 20, 2023, 3:43am UTC](https://discourse.mc-stan.org/t/does-cmdstan-remembers-last-run/33382/4 "2023-11-20T03:43:27Z")

</div>

Thanks JSocolar! But I’ve run it with the option seed=10 both times, and the same data. Does this still leaves room for a stochastic difference as you mention? Thank you!

---

<div class="post-metadata">

**Author:** ![jsocolar](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jsocolar/32/2486_2.png) [@jsocolar](https://discourse.mc-stan.org/u/jsocolar)\
**Post date:** [November 20, 2023, 4:03am UTC](https://discourse.mc-stan.org/t/does-cmdstan-remembers-last-run/33382/5 "2023-11-20T04:03:50Z")

</div>

Yes, because of the minor change in the model. The RNG streams will be the same, but since the model is different those RNG streams will direct the chains to different places.
