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

Adds free function tests for serializer #3036

Merged
merged 5 commits into from
Apr 21, 2021
Merged

Conversation

SteveBronder
Copy link
Collaborator

Submission Checklist

  • Run unit tests: ./runTests.py src/test/unit
  • Run cpplint: make cpplint
  • Declare copyright holder and open-source license: see below

Summary

For the refactoring of transform_inits() in the compiler we actually need the free functions to be in the serializer. See the discussion here for more info.

Intended Effect

Allow the serializer to perform the free'ing of constrained variables

How to Verify

Tests were added to do the same checks as the deserializer's free tests

./runTests.py ./src/test/unit/io/serializer_test.cpp

Side Effects

Documentation

Documentation for each of the free functions in serializer

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Steve Bronder

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.4 3.45 0.99 -1.49% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -1.2% slower
eight_schools/eight_schools.stan 0.11 0.11 1.02 1.71% faster
gp_regr/gp_regr.stan 0.16 0.16 1.0 -0.29% slower
irt_2pl/irt_2pl.stan 6.04 6.09 0.99 -0.93% slower
performance.compilation 91.09 89.28 1.02 1.99% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.67 8.71 1.0 -0.43% slower
pkpd/one_comp_mm_elim_abs.stan 29.97 29.8 1.01 0.58% faster
sir/sir.stan 130.9 142.07 0.92 -8.53% slower
gp_regr/gen_gp_data.stan 0.03 0.04 0.98 -1.64% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 2.98 3.03 0.98 -1.53% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.38 1.02 1.73% faster
arK/arK.stan 1.88 1.87 1.01 0.6% faster
arma/arma.stan 0.77 0.78 1.0 -0.46% slower
garch/garch.stan 0.56 0.56 1.01 0.68% faster
Mean result: 0.994446828693

Jenkins Console Log
Blue Ocean
Commit hash: 36f99c9


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

@SteveBronder
Copy link
Collaborator Author

@rok-cesnovar or @t4c1 do one of yinz have time to look this over?

@rok-cesnovar
Copy link
Member

I can take a look.

Copy link
Collaborator

@t4c1 t4c1 left a comment

Choose a reason for hiding this comment

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

Tests look good.

*/
template <typename StdVec, require_std_vector_t<StdVec>* = nullptr>
inline void write_free_simplex(const StdVec& x) {
for (auto&& ret_i : x) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for (auto&& ret_i : x) {
for (const auto& ret_i : x) {

Same for other loops.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.42 3.42 1.0 0.21% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.98 -2.37% slower
eight_schools/eight_schools.stan 0.11 0.11 1.0 -0.1% slower
gp_regr/gp_regr.stan 0.16 0.16 0.96 -4.32% slower
irt_2pl/irt_2pl.stan 5.98 6.01 0.99 -0.54% slower
performance.compilation 92.33 89.65 1.03 2.9% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.76 8.68 1.01 0.86% faster
pkpd/one_comp_mm_elim_abs.stan 28.68 30.17 0.95 -5.18% slower
sir/sir.stan 122.89 121.13 1.01 1.43% faster
gp_regr/gen_gp_data.stan 0.03 0.04 0.95 -5.43% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.07 3.0 1.02 2.15% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.4 0.99 -0.74% slower
arK/arK.stan 1.87 1.86 1.01 0.58% faster
arma/arma.stan 0.73 0.69 1.06 5.52% faster
garch/garch.stan 0.56 0.57 1.0 -0.26% slower
Mean result: 0.997325907183

Jenkins Console Log
Blue Ocean
Commit hash: 5bcb01a


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

@SteveBronder
Copy link
Collaborator Author

@t4c1 made the above fix ready for another look!

Copy link
Collaborator

@t4c1 t4c1 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.

@t4c1 t4c1 merged commit fc585b3 into develop Apr 21, 2021
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.

4 participants