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/929 stansummary cli11 #965

Merged
merged 18 commits into from
Jan 2, 2021
Merged

Conversation

mitzimorris
Copy link
Member

Submisison Checklist

  • Run tests: ./runCmdStanTests.py src/test
  • Declare copyright holder and open-source license: see below

Summary:

Replaced use of boost::program_options with lib CLI11,
which is a header-only C++11 library with appropriate open source license.

Intended Effect:

Pay down technical debt:

  • Simplify build process. Library boost::program_options is a non-header only library,
    it made the build process longer, greatly increased the amount of the console output,

  • Simplify makefiles

How to Verify:

Run unit tests

Side Effects:

NA

Documentation:

NA

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): Columbia University

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.45 3.38 1.02 2.0% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.92 -8.78% slower
eight_schools/eight_schools.stan 0.11 0.11 1.0 -0.16% slower
gp_regr/gp_regr.stan 0.15 0.15 0.98 -1.67% slower
irt_2pl/irt_2pl.stan 5.14 5.13 1.0 0.28% faster
performance.compilation 90.85 88.55 1.03 2.53% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.65 8.63 1.0 0.15% faster
pkpd/one_comp_mm_elim_abs.stan 29.16 28.95 1.01 0.72% faster
sir/sir.stan 136.31 139.62 0.98 -2.43% slower
gp_regr/gen_gp_data.stan 0.04 0.04 1.0 0.47% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.05 3.05 1.0 -0.02% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.37 0.38 0.99 -1.35% slower
arK/arK.stan 2.56 2.56 1.0 0.3% faster
arma/arma.stan 0.61 0.6 1.02 1.7% faster
garch/garch.stan 0.68 0.68 1.0 -0.42% slower
Mean result: 0.996194310003

Jenkins Console Log
Blue Ocean
Commit hash: 48ec304


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

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.

The only changes here are the library, right? So it's the same features as the existing stansummary, just different code?

Edit: Can look at this tomorrow

src/test/interface/stansummary_test.cpp Show resolved Hide resolved
@mitzimorris
Copy link
Member Author

The only changes here are the library, right? So it's the same features as the existing stansummary, just different code?

correct - the CLI11 library is a better version of boost::program_options. updated the code to use the library; changed the unit tests to match messages generated by CLI11.

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.

Review!

src/cmdstan/stansummary.cpp Show resolved Hide resolved
true);
app.add_option("input_files", filenames, "Sampler csv files.", true)
->required()
->check(CLI::ExistingFile);
Copy link
Member

Choose a reason for hiding this comment

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

This checks the input files are readable?

Copy link
Member Author

Choose a reason for hiding this comment

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

checks that they exist.
need to add checks for readibility, similar to check for writable output csv file.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

Totally optional, but when I get the error for readability I don't get the friendly --help prompt:

bbales2@tadpole:~/cmdstan-develop$ bin/stansummary output4.csv
Cannot read input csv file: output4.csv.

Compare this to:

bbales2@tadpole:~/cmdstan-develop$ bin/stansummary output12321.csv
input_files: File does not exist: output12321.csv
Run with --help for more information.

Copy link
Member

Choose a reason for hiding this comment

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

Also I don't get the --help prompt with the percentiles option:

bbales2@tadpole:~/cmdstan-develop$ bin/stansummary -p -5 output4.csv
Option --percentiles -5: values must be in range (1,99), inclusive, and strictly increasing.

Very optional to add this.

Copy link
Member Author

Choose a reason for hiding this comment

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

can't figure out how to plug in custom help message via CLI11 - spent several hours looking.
will give it another go.

Copy link
Member

Choose a reason for hiding this comment

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

Eh if it's not easy let's not worry about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

doable but not easy. worth doing as part of next PR.

src/test/utility.hpp Show resolved Hide resolved
src/cmdstan/stansummary_helper.hpp Show resolved Hide resolved
src/test/interface/stansummary_test.cpp Show resolved Hide resolved
src/cmdstan/stansummary_helper.hpp Show resolved Hide resolved
@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.41 1.0 -0.15% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.93 -7.52% slower
eight_schools/eight_schools.stan 0.11 0.11 0.95 -4.87% slower
gp_regr/gp_regr.stan 0.15 0.16 0.95 -5.76% slower
irt_2pl/irt_2pl.stan 5.17 5.18 1.0 -0.27% slower
performance.compilation 91.45 89.76 1.02 1.85% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.61 8.63 1.0 -0.24% slower
pkpd/one_comp_mm_elim_abs.stan 29.64 30.52 0.97 -2.96% slower
sir/sir.stan 135.34 135.18 1.0 0.12% faster
gp_regr/gen_gp_data.stan 0.04 0.04 1.0 0.28% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.06 3.06 1.0 0.12% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.37 0.37 0.99 -0.52% slower
arK/arK.stan 2.55 2.57 0.99 -1.11% slower
arma/arma.stan 0.6 0.6 1.0 -0.04% slower
garch/garch.stan 0.69 0.67 1.03 3.01% faster
Mean result: 0.988826866668

Jenkins Console Log
Blue Ocean
Commit hash: 5001b23


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

@mitzimorris
Copy link
Member Author

hi Ben, thanks for the thorough arg checking - this code should be far more robust.

also extremely useful w/r/t this PR: #925
there's a lot more checks that could/should be done for that PR, but it would be cool to get it in -
not sure I'll be able to get to it for this release.

@mitzimorris
Copy link
Member Author

@bbbales2 - ready for re-review

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 3.45 3.36 1.03 2.63% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.99 -1.39% slower
eight_schools/eight_schools.stan 0.11 0.11 0.97 -2.93% slower
gp_regr/gp_regr.stan 0.16 0.15 1.05 4.82% faster
irt_2pl/irt_2pl.stan 5.13 5.19 0.99 -1.14% slower
performance.compilation 92.37 89.65 1.03 2.95% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.63 8.62 1.0 0.06% faster
pkpd/one_comp_mm_elim_abs.stan 31.11 29.22 1.06 6.09% faster
sir/sir.stan 137.26 132.37 1.04 3.56% faster
gp_regr/gen_gp_data.stan 0.04 0.04 1.02 2.41% faster
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.04 3.07 0.99 -1.0% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.4 0.39 1.02 1.48% faster
arK/arK.stan 2.57 2.55 1.01 0.99% faster
arma/arma.stan 0.6 0.6 1.0 -0.33% slower
garch/garch.stan 0.67 0.68 0.99 -1.31% slower
Mean result: 1.01203272575

Jenkins Console Log
Blue Ocean
Commit hash: cd734b5


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

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 to me. Merge if you're happy with it. I don't think it's worth fussing over the --help thing if you've already spent time trying to get that working.

@mitzimorris mitzimorris merged commit 66554a4 into develop Jan 2, 2021
@WardBrian WardBrian deleted the feature/929-stansummary-cli11 branch September 6, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants