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

Switch to Tulip Solver #393

Merged
merged 6 commits into from
Jun 14, 2021
Merged

Conversation

andersonfrailey
Copy link
Collaborator

This PR is in response to issue #381. It switches us over to the Tulip solver for the stage 2 process. When running the scripts this morning it took about an hour and a half to create weights for both the PUF and CPS, compared to the 24+ hours it took last time I created the weights with our current solver. I'll post results comparisons in a followup comment.

cc @donboyd5

@andersonfrailey andersonfrailey added enhancement CPS PUF review ready extrapolation Issues/PRs related to our extrapolation techniques labels Jun 10, 2021
@andersonfrailey
Copy link
Collaborator Author

Relevant changes to the calculations can be found here. There are no major changes in output when compared to taxcalc 3.0.0.

@donboyd5
Copy link

Thanks @andersonfrailey. It looks to me like this is based on the early version of notes I made regarding Tulip. However, if you work through the full post of #381 you will find two major additional improvements:

  • scaling of the constraints, which makes the problem more stable numerically and allows it to reach optimality easily
  • replace an inefficient approach that was being used in taxdata whereby ~250k constraints were being added unnecessarily, with an approach that achieved the same goal without those unnecessary constraints by instead placing bounds on the variables

If you scroll toward the bottom of #381 you will find a drop-in replacement solver.jl function that implements all of the changes:

  1. Tulip instead of Cbc
  2. scaling of constraints
  3. replace unnecessary constraints with variable bounds

If you use this code (it should be easy to replace what you have now with this) I think you will find that it (a) reaches optimality easily, (b) it is MUCH faster still, and (c) it is more stable numerically.

@andersonfrailey
Copy link
Collaborator Author

Last commit makes the changes suggested by @donboyd5

@andersonfrailey
Copy link
Collaborator Author

If there are no more comments, I'll merge this at the end of the weekend.

@MattHJensen
Copy link
Contributor

Out of curiosity, what was runtime after the latest round of changes?

@andersonfrailey
Copy link
Collaborator Author

@MattHJensen running the full make script takes about 30 minutes now!

@andersonfrailey andersonfrailey merged commit 082c1ef into PSLmodels:master Jun 14, 2021
@andersonfrailey andersonfrailey deleted the tulipsolver branch June 14, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CPS enhancement extrapolation Issues/PRs related to our extrapolation techniques PUF ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants