Skip to content

Use vectorization and numba jitting for optimization - #184

Merged
mmcky merged 2 commits into
mainfrom
i-183
Nov 25, 2024
Merged

mmcky merged 2 commits into
mainfrom
i-183

Conversation

@kp992

@kp992 kp992 commented Nov 23, 2024 •

Copy link
Copy Markdown
Collaborator

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

Fixes #183

@jstac

jstac commented Nov 23, 2024

Copy link
Copy Markdown
Contributor

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

@kp992

kp992 commented Nov 23, 2024

Copy link
Copy Markdown
Collaborator Author

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

kp992 commented Nov 24, 2024

Copy link
Copy Markdown
Collaborator Author

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

kp992 commented Nov 24, 2024

Copy link
Copy Markdown
Collaborator Author

@mmcky

mmcky commented Nov 24, 2024 •

Copy link
Copy Markdown
Contributor

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

mmcky commented Nov 24, 2024

Copy link
Copy Markdown
Contributor

@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

kp992 commented Nov 24, 2024

Copy link
Copy Markdown
Collaborator Author

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

@mmcky mmcky left a comment

Copy link
Copy Markdown
Contributor

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
@mmcky
mmcky deleted the i-183 branch November 25, 2024 00:31

This branch was previously deployed

1 inactive deployment
commit — e474a1c6 Deployed Nov 24, 2024 by github-actions[bot]
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