-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Revisiting fast mapslices #28431
Comments
Nice package name! I agree, we need more stuff like #4. I feel like I’m ready to ascend to the next plane of higher order programming and be able to reason more about the operations, introspect composed functions (and higher order functions), and so-on. At least some of the tuple stuff might be feasible already without too many compiler improvements. E.g. much of the NamedTuple API seems to work well to me already. |
Any updates/thoughts on this? |
Constant propagation is still disabled by recursion, so to do this we'd still need |
I can make a PR for type stable tuple selection with TypedBools, but I'd want some confirmation from higher-ups that I wouldn't be wasting my time. |
It might be easiest to combine efforts with @simonbyrne's PR #32310, since that already has affirmation from a number of higher-ups. |
It seems like the outstanding issue from that PR is an eltype issue that could have been solved by ArrayLike, unless I'm mistaken. |
I was working on updating JuliennedArrays for 0.7 and I had some thoughts. Once we're over the 1.0 hill, it might be worth considering the (mostly, I think?) non-breaking infrastructure improvements that could lead to a fast mapslices.
There's been a ton of great work on constant propagation, but I think we still need Constant propogation through slurping #26050?
We need a cutoff to distinguish "large" tuples from "small tuples". It's usually faster to iterate over large tuples and unroll over small tuples. I think Tim Holy had a PR for this.
Type stable boolean indexing on small tuples with mixed type, e.g.
(1, 2.0, "three")[(true, false, true])
. This is only one of many operations that could become type-stable by unrolling small tuples (other examples include reduce, find, flatten, product, filter). This could all be done with lispy tuple iteration. If I understand correctly, creating a unified interface could unify lispy tuple iteration that is scattered across Base.Formalized reduction functions. This would look something like
etc. Knowing whether some function is an reduction of another function would enable some crucial optimizations; compare the performance of
mapslices
andmapreducedims
.None of this is critical but none of it is too breaking (I don't think). Just worth thinking about.
The text was updated successfully, but these errors were encountered: