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

introduce a protocol for compilation wrappers #9950

Merged
merged 1 commit into from
Mar 18, 2022

Conversation

froystig
Copy link
Member

@froystig froystig commented Mar 18, 2022

Fixes #9808, as far as type annotations are concerned.

cc #7733

@froystig froystig added the pull ready Ready for copybara import and testing label Mar 18, 2022
@froystig froystig requested a review from mattjj March 18, 2022 00:15
@froystig froystig self-assigned this Mar 18, 2022
jax/_src/stages.py Show resolved Hide resolved
@YouJiacheng
Copy link
Contributor

Hi!
I think maybe there is something wrong with Protocol for jit.
Protocol method allows type variance, i.e. covariant return type & contravariant arguments type(unfortunately Callable allows these too.)
But compilation wrappers should be invariant, i.e. only allow exact match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull ready Ready for copybara import and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

protocol/types for compilation wrappers
4 participants