-
Notifications
You must be signed in to change notification settings - Fork 37
New dimension mapping #327
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #327 +/- ##
==========================================
- Coverage 91.10% 90.16% -0.95%
==========================================
Files 9 9
Lines 1462 1342 -120
==========================================
- Hits 1332 1210 -122
- Misses 130 132 +2
Continue to review full report at Codecov.
|
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.
I don't think removing @generated
is a high priority/it can be done in a later PR.
Why do this and what are the objectives
The primary focus here is to replace the
to_parent_dims
andfrom_parent_dims
methods which were only really being used forSubArray
,Adjoint
,Transpose
, andPermutedDimsArray
. The point of those methods was originally to avoid repeatedly doing verbose extraction of the permutations for those last three arrays and to consolidate the number of generated functions for mapping across the indices ofSubArray
. However, there are some problems withSubArray
that require more than simple dimension to dimension mapping.The main goal here is to have something that actually produces an accurate dimension mapping for
SubArray
. A sort of secondary goal is to reduce many of the generated functions we've needed to supportSubArray
. Inference is working on local tests (Julia v1.6, v1.7, v1.8,) but seems to be failing CI on v1.6 for some reason. I guess I'll have to do some trial and error there through multiple PRs.This is not a proposal for a formal interface at this time.
In fact, I'm just removing the formal dimension mapping that
to_parent_dims
andfrom_parent_dims
composed, because it just wasn't working.I've tried to include a lengthy explanation of how the internals work in the code comments so everyone knows what's going on as we move forward.
Points of Review
@chriselrod, it appears this is still safe for the LV stuff (which was my main concern moving forward with a release). I would think it's possible to replace the generated function for
dense_dims
thatSubArray
requires but I haven't had time to figure out what's going on with that code there yet. I welcome any ideas you have to simplify that but I probably won't have time to figure it out and replace it with something that isn't generated and is performant.Other than that, I've checked that the methods I'm removing aren't used in any currently used version of
ArrayInterface
in downstream packaging.