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

Breakout common changes in fourier_gaussian #45

Merged
merged 1 commit into from
Sep 1, 2018

Conversation

jakirkham
Copy link
Member

In all cases sigma is squared, the result is divided by 2, and the negative of the result taken. These can be factored out into a common change to just sigma that is reused in all of the other computations. Admittedly Dask is smart enough to capture the reused computation of sigma squared, but it is not a symbolic algebra library. So it won't be able to pick up on the other changes, but we can. This should simplify the resulting graph and make it easy to reuse some common changes to sigma before tensordot is computed over multiple arrays and these changes applied.

In all cases `sigma` is squared, the result is divided by `2`, and the
negative of the result taken. These can be factored out into a common
change to just `sigma` that is reused in all of the other computations.
Admittedly Dask is smart enough to capture the reused computation of
`sigma` squared, but it is not a symbolic algebra library. So it won't
be able to pick up on the other changes, but we can. This should
simplify the resulting graph and make it easy to reuse some common
changes to `sigma` before `tensordot` is computed over multiple arrays
and these changes applied.
@jakirkham
Copy link
Member Author

Should add that if sigma is a concrete value, this computation occurs during graph construction. Thus Dask need not know anything about this computation. If sigma is a Dask Array, then Dask will construct nodes in the graph, but there should be significantly fewer nodes. Plus Dask should be able to fuse these ufunc operations into a single task.

On a more general note, as sigma is much smaller than the gaussian constructed. This computation should be much faster regardless of when it occurs.

@jakirkham jakirkham merged commit d5b0a4e into dask:master Sep 1, 2018
@jakirkham jakirkham deleted the ref_reused_comps_fourier_gaussian branch September 1, 2018 20:28
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.

1 participant