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/1149 pathfinder v2 #1155

Merged
merged 61 commits into from
Jul 21, 2023
Merged

Feature/1149 pathfinder v2 #1155

merged 61 commits into from
Jul 21, 2023

Conversation

mitzimorris
Copy link
Member

@mitzimorris mitzimorris commented Apr 14, 2023

Submisison Checklist

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

Summary:

adds logic to CmdStan's command method and argument parser to handle calls to Pathfinder.

Intended Effect:

expose Pathfinder.

How to Verify:

unit tests

Side Effects:

Documentation:

will be done in a separate PR

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:

@mitzimorris mitzimorris marked this pull request as draft April 14, 2023 21:57
@mitzimorris
Copy link
Member Author

Initial commit; adds logic for Pathfinder.
For optional diagnostic files, constructs unique_stream_writer and/or json_writer objects with nullptr to output stream.

Current branch stan/multi-path doesn't yet play nicely with json_writer.

@mitzimorris mitzimorris mentioned this pull request Apr 14, 2023
2 tasks
@WardBrian WardBrian linked an issue Jun 29, 2023 that may be closed by this pull request
@WardBrian
Copy link
Member

@mitzimorris you can fix the CI failure by changing resize(0) to clear() on those std::vectors. The reason linking is failing is that the unique_stream_writer has a forward-declared default constructor, but it never gets defined (this is probably a separate issue @SteveBronder should fix, but clear() will work and is more semantically meaningful)

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.

In general looks good, though I'd like to avoid using input/output arguments so much and just pairs/tuples/structs with the objects constructed in the function

src/cmdstan/command.hpp Outdated Show resolved Hide resolved
src/cmdstan/command.hpp Outdated Show resolved Hide resolved
src/cmdstan/command_helper.hpp Show resolved Hide resolved
src/cmdstan/command_helper.hpp Show resolved Hide resolved
src/cmdstan/command_helper.hpp Outdated Show resolved Hide resolved
src/cmdstan/command_helper.hpp Outdated Show resolved Hide resolved
src/cmdstan/command_helper.hpp Show resolved Hide resolved
@mitzimorris
Copy link
Member Author

requested changes made. ready for re-re-re-review.

Copy link
Member

@WardBrian WardBrian 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 changes, I’ll leave final review for @SteveBronder

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.

One optional comment but lgmt!!

src/cmdstan/command_helper.hpp Show resolved Hide resolved
@mitzimorris
Copy link
Member Author

mitzimorris commented Jul 19, 2023

current implementation of Pathfinder has default num_draws set to 2000. why? @bob-carpenter - opinion?
NUTS-HMC runs 2000 iterations by default becuase there are 1000 warmup iters and 1000 sampling iters.

defaults are set in file src/cmdstan/arguments/arg_pathfinder.hpp - easy to knock down from 2000 to 1000. or whatever.

@bob-carpenter
Copy link
Contributor

Our default for HMC produces 1000 warmup iterations and 1000 draws. That's why I suggested 1000 draws as the default number of Pathfinder draws. 1024 draws from the posterior would bring MCMC standard error down to about std-deviation / 32. But we're not even getting true posterior draws here and the importance ratios is a much better indicator of error than sample size.

…dev/cmdstan into feature/1149-pathfinder-v2

cially if it merges an updated upstream into a topic branch.
@SteveBronder
Copy link
Contributor

I think we just need to fix the merge conflict and we are good to go!

@mitzimorris
Copy link
Member Author

mitzimorris commented Jul 21, 2023

@syclik @WardBrian, @serban-nicusor-toptal - the issue here is boost::lexical_cast. proposed solution - update version of boost library?

cf: stan-dev/math#2919 (comment)

(at least, I think that's what the issue is - the CI logs have errors I don't understand)

@WardBrian
Copy link
Member

My proposed solution for this PR is just to merge - we know about the warning, and everything else passed as-is

Re, updating boost: stan-dev/math#2856

@mitzimorris mitzimorris merged commit 9783c9f into develop Jul 21, 2023
1 check failed
@WardBrian WardBrian deleted the feature/1149-pathfinder-v2 branch July 21, 2023 14:03
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.

Pathfinder command
6 participants