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

Use vectorization and numba jitting for optimization #184

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Use vectorization and numba jitting for optimization #184

merged 2 commits into from
Nov 25, 2024

Conversation

kp992
Copy link
Collaborator

@kp992 kp992 commented Nov 23, 2024

This PR optimizes the runtime of black_litterman lecture by using vectorization and numba jitting.

Fixes #183

@jstac
Copy link
Contributor

jstac commented Nov 23, 2024

Thanks @kp992 , this code looks much nicer. @mmcky could you please check the outputs?

@kp992
Copy link
Collaborator Author

kp992 commented Nov 23, 2024

I see that the build time is too high still. Locally its working fast for me. May be some issues with the ipywidgets? The slider is not working https://python-advanced.quantecon.org/black_litterman.html. See the SS

Screenshot 2024-11-23 at 1 27 38 PM

@kp992
Copy link
Collaborator Author

kp992 commented Nov 24, 2024

The slider is working locally for me but it doesn't on live pages because the html pages are static in nature.

@github-actions github-actions bot temporarily deployed to commit November 24, 2024 02:51 Inactive
@github-actions github-actions bot temporarily deployed to commit November 24, 2024 05:03 Inactive
@kp992
Copy link
Collaborator Author

kp992 commented Nov 24, 2024

I think the high timing issue is not consistent in this lecture. I added a debug commit a9c061f#commitcomment-149458134 and it just took 42s (https://674294b5a50f0309d83896e3--wonderful-lalande-528d1c.netlify.app/status).
After reverting the same commit, its ~7200s (https://6742b3a5c174582b302b578c--wonderful-lalande-528d1c.netlify.app/status).

This looks strange to me.

@mmcky
Copy link
Contributor

mmcky commented Nov 24, 2024

thanks @kp992.

We should remove the sliders as they won't work on the static site representation. Perhaps we can put the slider version in a collapsed code-block (and tag no-execute) and add a note block that says if you are running this lecture locally you can adjust the parameters using the piython slider.

Then we can see if the intermittent issue persists?

@mmcky
Copy link
Contributor

mmcky commented Nov 24, 2024

@kp992 I have just noticed that matsuyama also has a very long run time of 7000s. It may be worth checking if they both have something similar (like the widgets) that is hanging the execution?

matsuyama | 2024-11-04 08:33 | cache | 7206.91 | ✅ -- | -- | -- | -- | --

matsuyama
2024-11-04 08:33
cache
7206.91

@kp992
Copy link
Collaborator Author

kp992 commented Nov 24, 2024

Thanks @mmcky. Yes, I also believe that ipywidgets is the one hanging the build.

@github-actions github-actions bot temporarily deployed to commit November 24, 2024 22:48 Inactive
@kp992 kp992 requested a review from mmcky November 24, 2024 22:58
Copy link
Contributor

@mmcky mmcky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @kp992 this is looking great.

@mmcky mmcky merged commit 09fa72a into main Nov 25, 2024
6 checks passed
@mmcky mmcky deleted the i-183 branch November 25, 2024 00:31
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.

Long Run Time on Lecture causing build cache issues
3 participants