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

Jit the simulation part of lcm #99

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Jit the simulation part of lcm #99

wants to merge 5 commits into from

Conversation

mj023
Copy link
Collaborator

@mj023 mj023 commented Nov 6, 2024

This PR is supposed to tackle Issue #78. Jitting the returned simulation function massively increases the speed of the simulation when repeatedly simulating the same model with different parameters. Additionally the option to solve&simulate should consecutively run solve and then simulate instead of creating a combined function to further optimize the execution time.

As parts of the simulate function are not jittable, it has to be refactored. Therefore calculating additional targets and constructing the data frame have to be moved outside of simulate. Furthermore the code for creating the state choice space with sparse choices has to be modified to avoid creating dynamically-shaped arrays, as they can not be traced by JAX.

  • Jit the simulation function
  • Change solve&simulate
  • Move calculating additional targets
  • Move creating the data frame
  • Make sparse choice code jittable
  • Adapt tests to new structure

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.

1 participant