-
Notifications
You must be signed in to change notification settings - Fork 31
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
Transforming linalg with multiple generic operations #171
Comments
You could name the op directly with an attribute and have your transformations hook on to that. In the rewrite system going forward, we're going to move away from relying on attributes and hooking on to them. Instead, you would want your transformation to return handles to the two |
Hi @Mogball , |
Transformations on operations do not have to be through the pattern rewrite system. You can write a pass and do whatever mutations you want, however you want. But the pattern rewrite system provides structure and reusability. If you can write a pattern to match only the element-wise op and another one that only matches the matmul, then you can use patterns. |
This is the feature that @nicolasvasilache added in the latest commits, so I am closing this issue. Thanks! |
Hi all,
Following my previous post I now have a program with two generic operations in linalg:
The reason why I am implementing
matmul
throughlinalg.generic
is because I want to have the ability to:a) Changing the maps to implement
trans(A)*B
b) Fusing the multiplication by %alpha directly inside the main kernel
c) Making the framework generic without using specific named linalg ops
Issue
When I try to vectorize the linalg program it looks like only the first
linalg.generic
gets vectorized, while the second is left only tiled. Is this supposed to happen? I also tried to tile first and then to have a separatevectorize
transform, but as long as I have the element-wise operation in the middle, the vectorizer seems to not pick up the second operation.General question
Those two operations are quite different and need different transformations (fusing everything for
%0
+ the normal matmul transformations for%1
). Is it possible to "name" those operations and apply a transformation only on the specific named Op? For instance, we have aanchor-func
,anchor-op
in many transformations. Can we also have aanchor-name
+ aname
attribute in thelinalg.generic
operation?I am not sure, but I saw this issue: #149 and I was wondering if this was going in this direction. @apaszke , @Mogball could the strategy dialect be used in this case?
Thanks,
Giuseppe
The text was updated successfully, but these errors were encountered: