-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat/jaxtyping #746
Feat/jaxtyping #746
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Significant slowdown in the Stein Thinning method, unsure why as I don't believe I have changed anything functionally relevant here |
Performance reviewStatistically significant changes
Normalisation values for new data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an impressive effort! There are a couple of recurring issues:
- Nested unions (i.e.
Union[A, B, Union[C, D]]
) are redundant - they should be flattened out to e.g.Union[A, B, C, D]
- Any plan
Array
type hint that cannot have its shape annotated should have a comment noting why the shape is not possible to statically determine
For the remaining pyright complaints (only those in the
With these, the only remaining pyright complaints will be within the tests! |
Fixed the last one. Put some questions about the second one in the original comment. The first one I think I am misunderstanding as it seems like this would create import errors. Because the |
Hopefully responded to all your comments! I also removed some of the overloads that I think are not necessary |
Performance reviewStatistically significant changes
Normalisation values for new data: |
Adding more overloads that I missed |
Performance reviewStatistically significant changes
Normalisation values for new data: |
Performance reviewStatistically significant changes
Normalisation values for new data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! A few issues remain:
- A couple of unresolved comments from the first review
- Docs build is failing with
py:class reference target not found: 'n *d'
and'n *p'
- Tests are now failing!
- There are a couple of new Pyright complaints that have popped up (only 8 errors, though). Happy for these to be deferred to a ticket where we include a formal type checker (Include PyRight in CI #427 or Add a runtime type checker #755) if needed though
Since other PRs (for example #758) aren't introducing any performance changes, the degradation in Stein performance is an issue created by this PR. This bears investigating! |
Adding the lines ("py:class", "'n d'"),
("py:class", "'n p'"), to the Sphinx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I've found the source of the performance issues, and the docs build can be fixed by #746 (comment). There's still a couple of Pyright complaints, but I'm happy for these to be left for #427 if needed.
Once the docs build is passing, and the line causing the performance issues is either reverted or given an appropriate TODO and issue, I'm happy for this to be merged.
Ah I was doing thanks! |
…s JIT wrapped, could be slowing things down
I think we leave the remaining Pyright complaints for Beartype to help us with |
Performance reviewStatistically significant changes
Normalisation values for new data: |
Performance reviewStatistically significant changes
Normalisation values for new data: |
Performance reviewStatistically significant changes
Normalisation values for new data: |
…loads for dimension handler
Performance reviewNo significant changes to performance. |
Performance reviewNo significant changes to performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some final changes to the type hint for _atleast_2d_consistent
, and then I think we're done!
Performance reviewNo significant changes to performance. |
2 similar comments
Performance reviewNo significant changes to performance. |
Performance reviewNo significant changes to performance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Nicely done.
PR Type
Description
I do not touch the typing of the tests in this PR.
Implement Jaxtyping throughout. There should be minimal to no use of
ArrayLike
orArray
without shaping unless the shape is unknown.There should also be very few
Pyright
complaints now, except those I couldn't fix with the code as is.How Has This Been Tested?
Does this PR introduce a breaking change?
(Write your answer here.)
Screenshots
(Write your answer here.)
Checklist before requesting a review