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

Adding compile_function as execute option. #536

Merged
merged 9 commits into from
Aug 7, 2024
Merged

Conversation

alxmrs
Copy link
Contributor

@alxmrs alxmrs commented Aug 3, 2024

This allows users to use jit or aot compilation during the dag finalization process within executors. It should work straightforwardly on jax/numba style jit compilation. It's possible, but maybe ugly, to perform jax-aot-style compilation.

This should help make progress towards #304.

(Note to reviewer: I realized this could be merged ahead of #508, so I pulled it out into a non-dependent PR).

alxmrs added 5 commits August 3, 2024 16:55
This allows users to use jit or aot compilation during the dag finalization process within executors. It should work straightforwardly on jax/numba style jit compilation. It's possible, but maybe ugly, to perform jax-aot-style compilation.
@alxmrs alxmrs marked this pull request as ready for review August 3, 2024 16:08
@alxmrs
Copy link
Contributor Author

alxmrs commented Aug 3, 2024

I think this PR is ready to merge. The next things to explore in this area are:

Copy link
Member

@tomwhite tomwhite left a comment

Choose a reason for hiding this comment

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

This looks good - thanks for submitting it @alxmrs! Submitting the JAX work in smaller chunks is a good idea.

I made a couple of suggestions for changes, and it also looks like mypy is complaining.

(I'm interested in examples where compilation gives a performance increase - but that's not a blocker to merging this.)

cubed/tests/test_executor_features.py Outdated Show resolved Hide resolved
cubed/tests/test_executor_features.py Outdated Show resolved Hide resolved
alxmrs added 3 commits August 5, 2024 14:04
- remove todo for new test
- use pytest conventions
Simplifying type to make mypy happy.
@tomwhite tomwhite merged commit 479f1bf into cubed-dev:main Aug 7, 2024
11 checks passed
@tomwhite
Copy link
Member

tomwhite commented Aug 7, 2024

Thanks @alxmrs!

thodson-usgs pushed a commit to thodson-usgs/cubed that referenced this pull request Oct 24, 2024
* Adding `compile_function` as execute option.

This allows users to use jit or aot compilation during the dag finalization process within executors. It should work straightforwardly on jax/numba style jit compilation. It's possible, but maybe ugly, to perform jax-aot-style compilation.

* Add numba for compilation tests.

* Singlequotes not needed.

* Update function doc.

* Added another compile test for failure case.

* Added another test to ensure config was applied.

* Improve tests

- remove todo for new test
- use pytest conventions

* I don’t think numba jit works well on jax arrays.

* Update plan.py

Simplifying type to make mypy happy.
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.

2 participants