Skip to content

MAINT: update @jit(nopython=True) to @jit with numba>=0.59 - #395

Merged
mmcky merged 7 commits into
mainfrom
upd-jit
Nov 18, 2024
Merged

mmcky merged 7 commits into
mainfrom
upd-jit

Conversation

@mmcky

@mmcky mmcky commented May 8, 2024 •

Copy link
Copy Markdown
Contributor

This PR updates njit to use jit now that numba>=0.59 and nopython=True is now the default behaviour of the jit

This resolves QuantEcon/meta#112 for this lecture series

@mmcky

mmcky commented May 8, 2024 •

Copy link
Copy Markdown
Contributor Author
  • checked support files in _static/lecture_specific
  • link checker is false positive

@github-actions

github-actions Bot commented May 9, 2024 •

Copy link
Copy Markdown

@mmcky

mmcky commented May 9, 2024 •

Copy link
Copy Markdown
Contributor Author

There are a few speed regressions when applying these changes (right is this PR, left is current live site)

Screenshot 2024-05-09 at 11 45 20 AM

@kp992 would you have any time to review this and see what might be causing the slowdown in execution speed?

@kp992

kp992 commented May 9, 2024

Copy link
Copy Markdown
Contributor

@kp992

kp992 commented May 9, 2024

Copy link
Copy Markdown
Contributor

Hmm, I guess there can 2 reasons behind this:

  1. We are using GPU which calls cuda.jit internally in numba and the docs are just talking about CPU options.
  2. Maybe the cache isn't updated and so the execution time has increased?

@mmcky

mmcky commented Jun 13, 2024

Copy link
Copy Markdown
Contributor Author

@kp992 I don't fully understand your comments.

We are using GPU which calls cuda.jit internally in numba and the docs are just talking about CPU options.

This PR is strictly update the Numba jit so I don't understand why GPU is involved?

Maybe the cache isn't updated and so the execution time has increased?

For any lecture that has had code change then the cache should be invalidated and the lecture is run fresh.

Perhaps we can link up and discuss this?

@kp992

kp992 commented Jun 16, 2024

Copy link
Copy Markdown
Contributor

Thanks @mmcky, I can try looking into it in more details and discuss on this.

@kp992

kp992 commented Jun 24, 2024

Copy link
Copy Markdown
Contributor

@mmcky Can we re-run and see if the time results still differ? Maybe sometimes we might have hit some outlier?

@mmcky mmcky closed this Jun 26, 2024
@mmcky mmcky reopened this Jun 26, 2024
@mmcky

mmcky commented Jun 26, 2024

Copy link
Copy Markdown
Contributor Author

@kp992 there are still large differences:

Screenshot 2024-06-26 at 2 18 01 PM

@kp992

kp992 commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

I will try to debug what's creating these differences.

@mmcky

mmcky commented Nov 18, 2024 •

Copy link
Copy Markdown
Contributor Author
  • recheck results with latest anaconda environments to see if issue persists.

@github-actions

github-actions Bot commented Nov 18, 2024 •

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request November 18, 2024 05:42 Inactive
@mmcky

mmcky commented Nov 18, 2024

Copy link
Copy Markdown
Contributor Author

@kp992 and @HumphreyYang it looks like many of the large differences have resolved in the latest run and versions of numba.

@mmcky
mmcky merged commit 9ec9e13 into main Nov 18, 2024
@mmcky
mmcky deleted the upd-jit branch November 18, 2024 05:47
@kp992

kp992 commented Nov 19, 2024

Copy link
Copy Markdown
Contributor

Thanks @kp992. This looks great and clean!

This branch was previously deployed

1 inactive deployment
pull request — 362fab55 Deployed Nov 18, 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.

Track Changes in @jit in Numba Version0.59.0.

2 participants