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

Add model compile information to stdout and csv #896

Merged
merged 3 commits into from
Nov 24, 2020

Conversation

rok-cesnovar
Copy link
Member

@rok-cesnovar rok-cesnovar commented Jun 28, 2020

Submisison Checklist

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

Summary:

Addresses a part of #887

Add models compile information (stanc version and flags used) to the stdout and CSV.

Example:

data
  file = examples/bernoulli/bernoulli.data.json
init = 2 (Default)
random
  seed = 21139381 (Default)
output
  file = output.csv (Default)
  diagnostic_file =  (Default)
  refresh = 100 (Default)
stanc_version = stanc3 66c38187 (Unix)
stancflags = --warn-pedantic
# init = 2 (Default)
# random
#   seed = 21139381 (Default)
# output
#   file = output.csv (Default)
#   diagnostic_file =  (Default)
#   refresh = 100 (Default)
# stanc_version = stanc3 66c38187 (Unix)
# stancflags = --warn-pedantic

This should be included to make reproducing easier, especially with stanc optimization flag now available.

The tests will fail until stan-dev/stanc3#598 and stan-dev/stan#2932 are merged

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):
Rok Češnovar, Univ. of Ljubljana

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

@mitzimorris
Copy link
Member

for version

bin/stanc --version
stanc3 8b086da (Unix)

these are the compiler options:

  --debug-lex                      For debugging purposes: print the lexer actions
  --debug-parse                    For debugging purposes: print the parser actions
  --debug-ast                      For debugging purposes: print the undecorated AST, before semantic checking
  --debug-decorated-ast            For debugging purposes: print the decorated AST, after semantic checking
  --debug-generate-data            For debugging purposes: generate a mock dataset to run the model on
  --debug-mir                      For debugging purposes: print the MIR as an S-expression.
  --debug-mir-pretty               For debugging purposes: pretty-print the MIR.
  --debug-optimized-mir            For debugging purposes: print the MIR after it's been optimized. Only has an effect when optimizations are turned on.
  --debug-optimized-mir-pretty     For debugging purposes: pretty print the MIR after it's been optimized. Only has an effect when optimizations are turned on.
  --debug-transformed-mir          For debugging purposes: print the MIR after the backend has transformed it.
  --debug-transformed-mir-pretty   For debugging purposes: pretty print the MIR after the backend has transformed it.
  --dump-stan-math-signatures Dump out the list of supported type signatures for Stan Math backend.
  --warn-uninitialized             Emit warnings about uninitialized variables to stderr. Currently an experimental feature.
  --warn-pedantic                  Emit warnings about common mistakes in Stan programs.
  --auto-format                    Pretty prints the program to the console
  --print-canonical                Prints the canonicalized program to the console
  --version                        Display stanc version number
  --name                           Take a string to set the model name (default = "$model_filename_model")
  --O Allow                        the compiler to apply all optimizations to the Stan code.
  --o                              Take the path to an output file for generated C++ code (default = "$name.hpp")
  --print-cpp                      If set, output the generated C++ Stan model class to stdout.
  --allow_undefined                Do not fail if a function is declared but not defined
  --include_paths                  Takes a comma-separated list of directories that may contain a file in an #include directive (default = "")
  --use-opencl                     If set, try to use matrix_cl signatures.

not sure that all of these options will result in there being an output csv file - for the ones that make sense, we need to make sure that this doesn't break any CSV header parsing that exists.

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.03 4.0 1.01 0.8% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.97 -2.68% slower
eight_schools/eight_schools.stan 0.09 0.09 1.03 2.48% faster
gp_regr/gp_regr.stan 0.19 0.19 1.0 0.39% faster
irt_2pl/irt_2pl.stan 5.28 5.37 0.98 -1.72% slower
performance.compilation 87.33 85.07 1.03 2.59% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.69 7.72 1.0 -0.44% slower
pkpd/one_comp_mm_elim_abs.stan 20.49 21.55 0.95 -5.16% slower
sir/sir.stan 93.14 97.63 0.95 -4.82% slower
gp_regr/gen_gp_data.stan 0.04 0.04 0.99 -1.41% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.13 3.03 1.03 3.3% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.32 0.32 0.98 -1.94% slower
arK/arK.stan 1.79 1.79 1.0 -0.05% slower
arma/arma.stan 0.69 0.59 1.16 13.78% faster
garch/garch.stan 0.53 0.52 1.02 1.98% faster
Mean result: 1.00682847769

Jenkins Console Log
Blue Ocean
Commit hash: 8c5ef35


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

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.03 4.08 0.99 -1.07% slower
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 1.0 0.02% faster
eight_schools/eight_schools.stan 0.09 0.09 1.0 -0.0% slower
gp_regr/gp_regr.stan 0.19 0.19 0.98 -1.85% slower
irt_2pl/irt_2pl.stan 5.33 5.33 1.0 -0.15% slower
performance.compilation 85.9 85.0 1.01 1.05% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 7.69 7.74 0.99 -0.55% slower
pkpd/one_comp_mm_elim_abs.stan 23.26 22.66 1.03 2.56% faster
sir/sir.stan 92.18 98.31 0.94 -6.64% slower
gp_regr/gen_gp_data.stan 0.04 0.04 1.0 -0.47% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.01 3.1 0.97 -3.07% slower
pkpd/sim_one_comp_mm_elim_abs.stan 0.32 0.33 0.97 -2.81% slower
arK/arK.stan 1.78 1.78 1.0 0.2% faster
arma/arma.stan 0.66 0.59 1.12 10.43% faster
garch/garch.stan 0.54 0.52 1.04 3.91% faster
Mean result: 1.00241562789

Jenkins Console Log
Blue Ocean
Commit hash: 8c5ef35


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

is this ready for review?
or does this have to wait on stan-dev/stan#2932 ?

@rok-cesnovar
Copy link
Member Author

Waiting for that PR

Copy link
Contributor

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

lcbtm!

@rok-cesnovar
Copy link
Member Author

Thanks! This has to wait for 2932 in Stan, so this will not go in this release.

@rok-cesnovar rok-cesnovar merged commit 626aca4 into develop Nov 24, 2020
@rok-cesnovar rok-cesnovar deleted the feature/compile_info_in_csv_and_stdout branch November 24, 2020 18:53
Copy link
Member

@mitzimorris mitzimorris left a comment

Choose a reason for hiding this comment

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

LGTM!

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