Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/0123 complex spec #1720

Merged
merged 29 commits into from
Mar 3, 2020
Merged

Feature/0123 complex spec #1720

merged 29 commits into from
Mar 3, 2020

Conversation

bob-carpenter
Copy link
Member

Summary

This is the first pull request of two for adding support for autodiff of std::complex values in Stan. This PR has

  • a utility base class for std::complex implemented with a reduced-type form of the CRTP
  • specializations for std:complex<var> and std::complex<fvar<T>>
  • upgrades to the ad testing framework to deal with serializing/deserializing complex numbers
  • metaprogram extra case for complex number scalar type

Tests

The AD test framework was extended to deal with complex numbers and used to test the member operators (compound arithmetic assignments only).

Specialized tests were implemented for the constructors and defaults.

The tests for std::complex classes are in test/unit/math/mix/core/std_complex_test.cpp. Tests for additions to the testing framework itself are in the testing framework at test/unit/math/.

Side Effects

No

Checklist

  • Math issue complex numbers with vars #123 [but this doesn't solve the whole issue, this is just PR 1 of 2 to make reviewing easy]

  • Copyright holder: (fill in copyright holder information): Columbia University

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing (I only unit tested new additions; test-math-dependencies is broken)

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.95 4.91 1.01 0.67% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 1.0 -0.3% slower
eight_schools/eight_schools.stan 0.09 0.09 0.99 -0.52% slower
gp_regr/gp_regr.stan 0.22 0.23 0.98 -1.78% slower
irt_2pl/irt_2pl.stan 6.08 6.06 1.0 0.24% faster
performance.compilation 89.51 87.25 1.03 2.53% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.51 7.48 1.0 0.46% faster
pkpd/one_comp_mm_elim_abs.stan 20.79 21.44 0.97 -3.15% slower
sir/sir.stan 89.79 91.61 0.98 -2.02% slower
gp_regr/gen_gp_data.stan 0.05 0.05 0.98 -1.73% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.0 3.0 1.0 -0.13% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.32 0.31 1.0 0.25% faster
arK/arK.stan 1.73 1.74 1.0 -0.17% slower
arma/arma.stan 0.8 0.8 1.01 0.63% faster
garch/garch.stan 0.58 0.58 1.0 0.15% faster
Mean result: 0.996948794958

Jenkins Console Log
Blue Ocean
Commit hash: c679e61


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@bob-carpenter
Copy link
Member Author

@serban-nicusor-toptal There was a failure that looked like it was due to email:

https://jenkins.mc-stan.org/blue/organizations/jenkins/Math%20Pipeline/detail/PR-1720/1/pipeline/173

Here's the text from the failure from Always-run tests part 2, Windows Headers & Unit.

C:\Jenkins\workspace\Math_Pipeline_PR-1720>attrib -r -s /s /d 
File not found - C:\Jenkins\workspace\Math_Pipeline_PR-1720\*.*
java.nio.channels.ClosedChannelException[Clang (LLVM based)] Skipping execution of recorder since overall result is 'FAILURE'
An attempt to send an e-mail to empty list of recipients, ignored.

@serban-nicusor-toptal
Copy link
Contributor

Hey Bob,
java.nio.channels.ClosedChannelException in Jenkins points to the fact that the machine running your tests closed the channel, happens when a machine suddenly dies or network connectivity issues. Sometimes in rare cases a job can kill a machine ( cpu/gpu temps as an example ). See logs at the bottom here.

I can't be sure now if it's a Jenkins issue, I see that it's now running. Please let me know if it fails again with the same reason and I'll look into it.

Thanks

@bob-carpenter
Copy link
Member Author

@serban-nicusor-toptal --- yes, it failed again with the same error. I think that may be because the windows machine was offline. @bgoodri --- do you know if it's online again?

@bgoodri
Copy link
Contributor

bgoodri commented Feb 17, 2020 via email

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 5.08 4.96 1.02 2.3% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.97 -2.74% slower
eight_schools/eight_schools.stan 0.09 0.09 0.98 -2.49% slower
gp_regr/gp_regr.stan 0.23 0.22 1.01 1.22% faster
irt_2pl/irt_2pl.stan 6.07 6.06 1.0 0.08% faster
performance.compilation 88.06 87.5 1.01 0.63% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.63 7.48 1.02 2.02% faster
pkpd/one_comp_mm_elim_abs.stan 20.86 21.32 0.98 -2.21% slower
sir/sir.stan 92.6 89.67 1.03 3.17% faster
gp_regr/gen_gp_data.stan 0.04 0.05 0.98 -2.03% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.0 2.99 1.0 0.06% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.32 0.32 0.99 -1.45% slower
arK/arK.stan 1.74 1.74 1.0 -0.03% slower
arma/arma.stan 0.79 0.79 0.99 -0.66% slower
garch/garch.stan 0.58 0.58 0.99 -0.67% slower
Mean result: 0.998451035127

Jenkins Console Log
Blue Ocean
Commit hash: c679e61


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@bob-carpenter
Copy link
Member Author

Back online. Had to pull its power cord out of the socket.

Thanks, @bgoodri. Now all I need is a review.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 5.11 4.95 1.03 3.26% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 1.0 0.28% faster
eight_schools/eight_schools.stan 0.09 0.09 1.01 1.14% faster
gp_regr/gp_regr.stan 0.22 0.22 1.02 2.28% faster
irt_2pl/irt_2pl.stan 6.05 6.05 1.0 -0.0% slower
performance.compilation 89.31 87.05 1.03 2.53% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.5 7.3 1.03 2.61% faster
pkpd/one_comp_mm_elim_abs.stan 20.8 20.96 0.99 -0.77% slower
sir/sir.stan 91.6 91.96 1.0 -0.4% slower
gp_regr/gen_gp_data.stan 0.05 0.05 0.99 -0.84% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.01 2.99 1.01 0.72% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.33 0.31 1.08 6.99% faster
arK/arK.stan 1.74 1.76 0.99 -1.1% slower
arma/arma.stan 0.79 0.78 1.01 1.28% faster
garch/garch.stan 0.58 0.53 1.11 10.2% faster
Mean result: 1.02014489658

Jenkins Console Log
Blue Ocean
Commit hash: ed61d81


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@bbbales2 bbbales2 self-assigned this Feb 19, 2020
Copy link
Collaborator

@SteveBronder SteveBronder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple quick review comments

Comment on lines 52 to 55
/**
* Destroy this complex number.
*/
~complex() {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you able to use the implicit destructor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to follow the "rule of three". From the Wikipedia:

The rule of three (also known as the Law of The Big Three or The Big Three) is a rule of thumb in C++ (prior to C++11) that claims that if a class defines any of the following then it should probably explicitly define all three: destructor. copy constructor. copy assignment operator.

I'm overloading the define of the copy operator to deal with non-matching types (like assigning std::complex<double> to std::complex<var>. So I'm not sure where this falls. I'm happy to get rid of it if it's OK style.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to look around, somewhere there is a rule set of which constructors getting created for free when you define other ones. Here I just meant

~complex() = default;

Comment on lines 43 to 44
template <typename U>
complex(const U& x) : base_t(x) {} // NOLINT(runtime/explicit)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be marked explicit? Also should this be templated to only allow scalar types with something like

template <typename U, typename = require_stan_scalar_t<U>>
explicit complex(const U& x) : base_t(x) {}  // NOLINT(runtime/explicit)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't work if it's marked explicit. We need to be able to promote arithmetic types to complex if necessary.

It will only compile if U is something assignable to the class template T, which means the restriction is to arithmetic types (primitives) or var (or to fvar<U> for the forward version). Elsehwere, the decision has been not to tighten down the signature with type traits unless needed for ambiguity resolution.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't work if it's marked explicit. We need to be able to promote arithmetic types to complex if necessary.

As is yes but if you added the operator= for scalar types it would work right?

I'm fine with it not being explicit but I'll leave this open for now until I have time to sit down and play with this / look at the spec

(also fyi my review is a comment and not a request for changes so everything here is optional)

* Construct a complex number with zero real and imaginary
* components.
*/
complex() : base_t() {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule of 5? I'm pretty sure making a non-default constructor or destructor turns off the implicit move constructors

Copy link
Member Author

@bob-carpenter bob-carpenter Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default constructor would have the wrong behavior. std::complex() needs to initialize the real and imaginary components to zero.

There is nothing to move, so move semantics won't do anything. Should I still define the move copy constructor and copy assignment and just define them = default?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I still define the move copy constructor and copy assignment and just define them = default?

I think it's fine to add them if the compiler wants to use them and they can just be default

Comment on lines 65 to 68
template <typename V>
complex_type& operator=(const V& x) {
return base_t::operator=(x);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can V be literally any type? Adding a require to restrict types here may be good

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V must be assignable to the value type of the complex number. It won't compile otherwise. Adding an enable_if restriction would just cause the compiler to fail in a different way. We don't need the restriction for disambiguation.

My understanding is that we generally do not want to try to explicitly enumerate all the possible instantiations of a template parameter with type traits. We don't do that on any of the prim functions in our math library, for example. You can try to pass a std::string to log1m, but it won't compile.

Comment on lines 93 to 95
complex_type& derived_complex_ref() {
return static_cast<complex_type&>(*this);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just call this derived()? I think that's common

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't do that because it's not an exact use of the CRTP. It's just CRTP-like, so there's no template parameter Derived. Instead there's a template parameter T and the equivalent of derived is std::complex<T>, which is typedef-ed as complex_type.

But I'm happy to change it if you think that'd be clearer.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with it as is, but imo I'd rather just have a CRTP than CRTP-like.

Comment on lines +16 to +17
class complex<stan::math::fvar<T>>
: public stan::math::complex_base<stan::math::fvar<T>> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a crtp should this be

public stan::math::complex_base<complex<stan::math::fvar<T>>>

So the type is recurrent in the base class?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The complex (which would have to be std::complex) is redundant. I only take the value type T as the template parameter, but the "derived" class is std::complex<T>. If I suppoied all of complex<fvar<T>>, then I'd just have to go fishing the T out with traits again.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is definitely redundant, though if I use a pattern I like keeping it standard instead of 'ish. But whether a strict CRTP pattern here would be better is totally subjective.

then I'd just have to go fishing the T out with traits again.

Would argue that type traits change here would be fishing in a barrel

  using value_type = value_type_t<V>;

  /**
   * Derived complex type used for function return types.
   */
  using complex_type = V;

template <typename X>
complex_type& operator/=(const std::complex<X>& other) {
using stan::math::square;
value_type sum_sq_im = square(other.real()) + square(other.imag());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can/should these be auto?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the feeling about auto when there's a simple type we can use? I find the explicit types simpler if they're small. I'm not bothered either way, so let me know. Our existing code is all over the place on this issue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like auto so that type deduction just rides through instead of performing an implicit cast if there is a mismatch. I'm fine either way here

@bob-carpenter
Copy link
Member Author

bob-carpenter commented Feb 19, 2020

@SteveBronder : Thanks for reviewing!

I replied to all the questions. I think everything's OK as is, but there are quite a few things you suggested I'd be OK changing, so let me know which ones you want me to change after seeing why I did them the way I did.

@SteveBronder
Copy link
Collaborator

^word! Yeah consider all that optional. I can also goof around and make a branch with those things to see how they'd look

Copy link
Member

@bbbales2 bbbales2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the std::complex stuff.

I'm a little concerned about the way scalar_type is written. Not obvious to me that this is what we want.

~complex_base() {}

/**
* Return a reference to thi class cast to the derived complex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this

*
* @param[in] x the value to set the real part to
*/
void real(const value_type& x) { re_ = x; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't this be something that can get cast to a value_type (like a double)? Looks like the stuff here is just pass by value: https://en.cppreference.com/w/cpp/numeric/complex/real

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can generalize that and avoid some casting to the value_type.

using stan::math::value_of_rec;
std::complex<T> z(x, y);
EXPECT_EQ(1.1, value_of_rec(z.real()));
EXPECT_EQ(2.3, value_of_rec(z.imag()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these two lines hardcoded? Can't it be:

EXPECT_EQ(value_of(x), value_of_rec(z.real()));
EXPECT_EQ(value_of(y), value_of_rec(z.imag()));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

* @tparam T value type of complex number
*/
template <typename T>
struct scalar_type<std::complex<T>> {
Copy link
Member

@bbbales2 bbbales2 Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a bit weird. The complex number is the scalar type. I feel like the way this is written it should be called autodiff_scalar_type.

return_type leans on scalar_type (

struct return_type {
), and so return_type<std::complex<var>, double>::type would be var, which isn't what I'd expect mathematically.

@bob-carpenter
Copy link
Member Author

bob-carpenter commented Feb 20, 2020 via email

@bob-carpenter
Copy link
Member Author

Looks like we're going to put this PR on hold yet again while I rewrite the meta libs. Then I have to come backand fix this. So please don't merge this.

@bob-carpenter bob-carpenter changed the title Feature/0123 complex spec [WIP] Feature/0123 complex spec Feb 21, 2020
@bbbales2
Copy link
Member

This doesn't need put on hold. It's the next pull that has all the complexity, right? And even then we can redo the metaprograms afterwards. It doesn't change anything.

The only thing I'd say is this function:

void real(const value_type& x)

should accept more than a value type since apparently that makes sense and then this goes in.

Like:

std::complex<var> x;

x.real(5.0)

Should work and just cast that double to a var. If this already happens and I'm just not understanding the C++, lemme know and I'll approve (and merge after tests pass).

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 5.04 4.76 1.06 5.48% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -0.71% slower
eight_schools/eight_schools.stan 0.09 0.09 0.98 -2.0% slower
gp_regr/gp_regr.stan 0.21 0.22 0.98 -2.0% slower
irt_2pl/irt_2pl.stan 6.1 6.06 1.01 0.59% faster
performance.compilation 88.1 86.38 1.02 1.95% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.29 7.44 0.98 -2.05% slower
pkpd/one_comp_mm_elim_abs.stan 20.56 20.28 1.01 1.34% faster
sir/sir.stan 91.03 90.43 1.01 0.66% faster
gp_regr/gen_gp_data.stan 0.04 0.05 0.98 -2.04% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.96 2.95 1.0 0.23% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.31 0.34 0.91 -10.28% slower
arK/arK.stan 1.73 1.74 1.0 -0.33% slower
arma/arma.stan 0.74 0.75 0.99 -1.39% slower
garch/garch.stan 0.53 0.52 1.02 1.8% faster
Mean result: 0.99521814017

Jenkins Console Log
Blue Ocean
Commit hash: fe1bb95


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@bob-carpenter
Copy link
Member Author

From @SteveBronder:

I'm okay with it as is, but imo I'd rather just have a CRTP than CRTP-like.

The path of least resistance is to change the code so I can get this thing out before more people pile on with change requests. I'll do this:

  • in the constructor of T, I'll have everywhere I have T as a template parameter to the base class, use U = std::complex<T> instead

  • defining using T = U::value_type; right up front in the class because it's the T I actually need everywhere in the class

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.88 4.82 1.01 1.13% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -1.17% slower
eight_schools/eight_schools.stan 0.09 0.09 1.03 2.65% faster
gp_regr/gp_regr.stan 0.22 0.22 1.01 0.73% faster
irt_2pl/irt_2pl.stan 6.04 6.08 0.99 -0.66% slower
performance.compilation 89.11 87.18 1.02 2.17% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.33 7.31 1.0 0.17% faster
pkpd/one_comp_mm_elim_abs.stan 20.62 20.57 1.0 0.22% faster
sir/sir.stan 89.09 90.21 0.99 -1.25% slower
gp_regr/gen_gp_data.stan 0.04 0.05 0.99 -0.83% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.96 2.96 1.0 0.09% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.31 0.32 0.95 -4.9% slower
arK/arK.stan 1.74 1.76 0.99 -1.5% slower
arma/arma.stan 0.72 0.72 1.0 0.27% faster
garch/garch.stan 0.59 0.6 0.99 -0.81% slower
Mean result: 0.997833625598

Jenkins Console Log
Blue Ocean
Commit hash: fe1bb95


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@bob-carpenter bob-carpenter changed the title [WIP] Feature/0123 complex spec Feature/0123 complex spec Feb 28, 2020
@bob-carpenter bob-carpenter removed the wip label Feb 28, 2020
bbbales2
bbbales2 previously approved these changes Feb 28, 2020
@SteveBronder
Copy link
Collaborator

@mitzimorris it looks like this is failing because Jenkins can't find stanc in cmdstan? Do you know what's up with that?

https://jenkins.mc-stan.org/job/CmdStan/job/downstream_tests/1453/console

--- Translating Stan model to C++ code ---
bin/stanc  --o=src/test/test-models/transformed_data_rng_test.hpp src/test/test-models/transformed_data_rng_test.stan
--- Translating Stan model to C++ code ---
bin/stanc  --o=src/test/test-models/print_uninitialized.hpp src/test/test-models/print_uninitialized.stan

bin/stanc: 1: bin/stanc: Not: not found
make/program:42: recipe for target 'src/test/test-models/transformed_data_rng_test.hpp' failed

@serban-nicusor-toptal
Copy link
Contributor

@SteveBronder noticed a bit earlier too, on it

@SteveBronder
Copy link
Collaborator

SteveBronder commented Mar 2, 2020

@serban-nicusor-toptal much appreciated!

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.89 4.87 1.0 0.33% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -1.06% slower
eight_schools/eight_schools.stan 0.09 0.09 1.04 3.43% faster
gp_regr/gp_regr.stan 0.22 0.22 1.0 0.24% faster
irt_2pl/irt_2pl.stan 6.07 6.07 1.0 0.08% faster
performance.compilation 89.82 87.16 1.03 2.96% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.66 7.67 1.0 -0.09% slower
pkpd/one_comp_mm_elim_abs.stan 20.37 20.91 0.97 -2.62% slower
sir/sir.stan 97.11 98.5 0.99 -1.43% slower
gp_regr/gen_gp_data.stan 0.05 0.05 1.01 1.29% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.95 2.97 0.99 -0.89% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.31 0.33 0.93 -7.91% slower
arK/arK.stan 1.74 1.75 0.99 -0.93% slower
arma/arma.stan 0.66 0.66 1.0 0.07% faster
garch/garch.stan 0.51 0.58 0.88 -13.09% slower
Mean result: 0.988548382091

Jenkins Console Log
Blue Ocean
Commit hash: 1f18017


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@bob-carpenter
Copy link
Member Author

@bbbales2 I'm afraid we need another review for this one after changes. There's not a huge rush here because I'm working on a branch that has already merged this.

@bob-carpenter
Copy link
Member Author

bob-carpenter commented Mar 3, 2020 via email

Copy link
Member

@bbbales2 bbbales2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

*/
using value_type = V;
using value_type = ValueType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is our standard to do underscore_naming for usings and CamelCase for template parameters?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's consistent with how I understand the code but it's weird to see if directly in a situation like this :/.

@bbbales2 bbbales2 merged commit 006b12b into develop Mar 3, 2020
@bob-carpenter
Copy link
Member Author

bob-carpenter commented Mar 3, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants