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

njit the estimation pipeline end-to-end #4

Open
jessegrabowski opened this issue Feb 3, 2023 · 1 comment
Open

njit the estimation pipeline end-to-end #4

jessegrabowski opened this issue Feb 3, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jessegrabowski
Copy link
Owner

The main gEconModel is currently not jittable and cannot be rewritten as a jitclass because of its heavy dependence on sympy.

During estimation, however, I want the main loop of steady state -> log linearization -> BK check -> Kalman Filter to be entirely jit-compiled. This is currently accomplished using a set of functions in estimation.estimation_utilities that extract the necessary components from the model and jit them all separately.

I think it would be better to instead "compile" the model to a jitclass that holds all the necessary functionality. This would also clean up the codebase, which is currently too fragmented into cluttered "utility" files.

@jessegrabowski jessegrabowski added the enhancement New feature or request label Feb 3, 2023
@jessegrabowski
Copy link
Owner Author

This was partially implemented by #29 accidentally. The new function numba_tools.utilities.numba_lambdify makes very fast numba code from sympy equations. In addition, they can be pickled. That means steady state and log linearization are fully jitted (but only for solver="cyclic_reduction", gensys still needs to be jitted). BK check is jitted in estimation.estimation_utilities.check_bk_condition, but not in the model itself -- this is code duplication and should be unified. The kalman filters are also almost fully jitted. The last barrier to fast sampling is the build_and_solve function, but I'd like to rebuild the whole sampling pipeline if possible.

@jessegrabowski jessegrabowski changed the title Refactor method of compiling model to numba njit the estimation pipeline end-to-end Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant