--
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.
I ran everything twice and the results are stable (each size is evaluated
2000 times for each system).
The horizontal axis is total number of elements in two matrices
a and b of type Matrix<var, Dynamic, Dynamic>. So the biggest eval, with
almost 2^12 (4096 or so) variables is multiplying two
(45 x 45) matrices. The functions being evaluated (and autodiffed for
gradients) are:
eigen: (a * b).sum()
stan: sum(multiply(a,b))
The operator*() and .sum() operations are built into Eigen, whereas
the sum() and multiply() operations are from stan::agrad.
For systems other than Stan, the Eigen version is used in both graphs.
I imagine what's going on is that Eigen is very clever about
using the traits defined in std::numeric_limits<stan::agrad::var>
to increase memory locality by doing blocking operations.
In all other evaluations, CppAD was slower than Adept, but here
CppAD is a win because it also defines numeric_limits.
Maybe we should just be calling Eigen's operator*() for multiplying two var
matrices, though it'll probably take about 30--50% or so more memory. Our
implementation of multiply() reduces the number of vari instances, each of
which have 16 additional bytes of overhead for a vtable pointer and adjoint,
for an additional cost of something like 32 * (N^3 - N^2) bytes for using
Eigen's operator*().
Of course, we can't just call Eigen for var * double versions, and we
don't exactly do a lot of matrix-matrix products of parameters, so it's
probably no big deal. Just a bit embarassing for the paper!
- 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.