[ge_arrow] Update to JAX and compare runtime#717
Conversation
|
📖 Netlify Preview Ready! Preview URL: https://pr-717--sunny-cactus-210e3e.netlify.app (b58cafe) 📚 Changed Lecture Pages: aiyagari, cake_eating_numerical, career, coleman_policy_iter, egm_policy_iter, ge_arrow, harrison_kreps, ifp, ifp_advanced, jv, lake_model, lqcontrol, mccall_correlated, mccall_fitted_vfi, mccall_model, mccall_model_with_separation, mccall_q, odu, optgrowth_fast, two_auctions, wald_friedman_2 |
|
📖 Netlify Preview Ready! Preview URL: https://pr-717--sunny-cactus-210e3e.netlify.app (bf55c41) 📚 Changed Lecture Pages: aiyagari, cake_eating_numerical, career, coleman_policy_iter, egm_policy_iter, ge_arrow, harrison_kreps, ifp, ifp_advanced, jv, lake_model, lqcontrol, mccall_correlated, mccall_fitted_vfi, mccall_model, mccall_model_with_separation, mccall_q, odu, optgrowth_fast, two_auctions, wald_friedman_2 |
|
📖 Netlify Preview Ready! Preview URL: https://pr-717--sunny-cactus-210e3e.netlify.app (253dea6) 📚 Changed Lecture Pages: aiyagari, cake_eating_numerical, career, coleman_policy_iter, egm_policy_iter, ge_arrow, harrison_kreps, ifp, ifp_advanced, jv, lake_model, lqcontrol, mccall_correlated, mccall_fitted_vfi, mccall_model, mccall_model_with_separation, mccall_q, odu, optgrowth_fast, two_auctions, wald_friedman_2 |
|
📖 Netlify Preview Ready! Preview URL: https://pr-717--sunny-cactus-210e3e.netlify.app (be07276) 📚 Changed Lecture Pages: aiyagari, cake_eating_numerical, career, coleman_policy_iter, egm_policy_iter, ge_arrow, harrison_kreps, ifp, ifp_advanced, jv, lake_model, lqcontrol, mccall_correlated, mccall_fitted_vfi, mccall_model, mccall_model_with_separation, mccall_q, odu, optgrowth_fast, two_auctions, wald_friedman_2 |
- Replace `@partial(jax.jit)` with `jax.jit` on the main function `compute_rc_model`. - Write a function to compute example 3 and add `jax.jit` decorator.
📖 Netlify Preview Ready!Preview URL: https://pr-717--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed Lectures
Build Info
|
Updated the
ge_arrow.mdto JAX and complemented the styling consistent with the operation manual.Key changes:
RecurCompetitiveclass as aNamedTuple.compute_rc_modelfunction. Inside this function, arguments of sub-functions can be written in the same way as the definitions in the theory part.jittedthe main computation function, and usedjax.lax.fori_loopto conduct loops.Update: Runtime Comparison Between
JAX (GPU),JAX (CPU), andNumPyMethodology: nearly the same as in #654
JAXversion uses the code in this PR, while theNumPyversion uses the code inmain.JAX (GPU)is measured using Google ColabT4 GPUruntime.qe.timeitover 1,000 iterations.Results:
JAX (CPU)>NumPy>JAX (GPU).