-
Notifications
You must be signed in to change notification settings - Fork 3k
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
time to jit a function grows superlinear with memory accessed by function #1776
Comments
It's because the code says
If you use Does this resolve the question? I'm not sure what we could do better here, although I admit it's a bit surprising! |
And just to show how I figured this out: I used
and it's then obvious why this is slow: the program is very big. Contrast the
|
Thank you very much for this prompt and insightful help. |
Here is a simple example, which numerically integrates the product of two Gaussian pdfs. One of the Gaussians is fixed, with mean always at 0. The other Gaussian varies in its mean:
The function looks seemingly simple, but it doesn't scale at all:
For reference, the unjitted function, applied to
integr_resolution=6400
takes 0.02s.I thought that this might be related to the fact that the function is accessing a global variable. But moving the code to set up the integration points inside of the function has no notable influence on the timing. The following code takes 5.36s to run. It corresponds to the table entry with 1600 which previously took 5.2s:
What is happening here?
The text was updated successfully, but these errors were encountered: