-
Notifications
You must be signed in to change notification settings - Fork 11
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
haliax.dot: allow defining output order a la einsum #2
Comments
I really like Haliax so far I do think that we should proper einsum support. To me the string often doubles as documentation. |
yeah I was thinking that too. I added out_axes in the secret-ish |
(and thanks!) |
Ideally I would prefer a similar syntax to einops as shown here. I very much prefer the explicit We can enforce that instead of random i j k the real axes names we have in haliax are used on the left hand side. This does have some disadvantage over the dot method in terms of privacy of axes. For something like bmm the above code will break while the dot code will work just fine. This can be countered by batching over the axes not mentioned? |
Yeah, I am coming around to this point of view. WDYT about the syntax for new-einops-style rearrange, particularly the dev version? We could support this syntax for dot with something like:
|
Looks great to me. Pretty much what I am looking for (maybe except the last one haha) We can also have a hax.einsum which calls hax.dot after resolving all this stuff instead of expanding hax.dot |
@reachtarunhere any chance I could get you to look at https://github.com/stanford-crfm/haliax/pull/63/files#diff-b1aa00624eecf36f969b62aaee977cfac454841fa3dc40f480759e68bda5473bR57 and lmk what you think? Just asking you to glance at the docs, but if you want to look deeper that would be lovely too :-) |
@dlwh just back from vacation. Happy to take a look later today :) |
Sidi asked for something like this, and I think it's a good idea. (He asked for proper einsum support, which is also a good idea)
cf stanford-crfm/levanter#107
I'd like to support something like:
which would force the order
The text was updated successfully, but these errors were encountered: