Performance Regression

41 views
Skip to first unread message

Michael Betancourt

unread,
Dec 28, 2014, 12:25:11 PM12/28/14
to stan...@googlegroups.com
I just wanted to mention some performance regression that’s taken place
since 2.4.0, mostly due to all of the NaN checking that was added.

First-order gradients have gradually slowed by about 5% from a variety
of contributions (the new memory pattern, nested autodiff, NaN checking,
etc). Each commit yields a pretty marginal change in performance and
only the aggregate performance manifests in a noticeable slowdown,
at least as far as I can tell.

Higher-order derivatives took a huge hit from the introduction of fvar
NaN checks in https://github.com/stan-dev/stan/commit/2c4cc3ee5b78fa7cee563a1d9faf569b17c8f447,
slowing down by over 67%. There is no immediate solution to this
slow down without removing the NaN checks — in Nomad I avoided
this by having the checks templated and readily turned off by the user
when speed is a concern.

Bob Carpenter

unread,
Dec 29, 2014, 11:44:21 AM12/29/14
to stan...@googlegroups.com
Thanks for running this.

Any idea what the contribution of the first-order stuff is
among memory, nesting, and NaN? The NaN tests are piecemeal
depending on what the underlying functions do.

The functionals have been changed to use nesting by default.

Does anyone know if there's a conditional for every use of
class statics? I thought they did an implicit lazy eval.
If so, this could be an even bigger slowdown.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

Reply all
Reply to author
Forward
0 new messages