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

Terrible performance of NUTS with refactored ODE API #3676

Closed
michaelosthege opened this issue Nov 5, 2019 · 2 comments
Closed

Terrible performance of NUTS with refactored ODE API #3676

michaelosthege opened this issue Nov 5, 2019 · 2 comments
Assignees
Labels

Comments

@michaelosthege
Copy link
Member

michaelosthege commented Nov 5, 2019

Description of your problem

My last-minute PR #3634 refactored the ODE API towards more explicit shapes. Unfortunately (and not detected by my benchmark) it also slowed down NUTS by about 50x compared to the original implementation by Demetri.

For reference, the approximate seconds/it/chain:

original refactor
NUTS 0.1 5
DEMetropolis 0.05 0.05

Also see the discussion over at #3634.

Versions and main components

@michaelosthege michaelosthege self-assigned this Nov 5, 2019
@junpenglao
Copy link
Member

Ouch

@michaelosthege
Copy link
Member Author

When printing the parameters of every forward simulation, I made three interesting observations:

  1. in the refactored implementation, NUTS has a larger tree size & depth --> more forward simulations
  2. it looks like no parameter set is simulated twice --> sensitivity caching works fine(?)
  3. the parameters are printed with 8 digits before & 16 digits after the refactor

So my hypothesis would be that by consistently using floatX, NUTS does more accurate leapfrogs, leading to more gradient evaluations and higher runtime.

michaelosthege added a commit to michaelosthege/pymc that referenced this issue Nov 18, 2019
closes pymc-devs#3676
+ order of sensitivity columns now beginning with y0
+ tests were aligned
+ order of y0, theta now everywhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants