-
Notifications
You must be signed in to change notification settings - Fork 28
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
[LFRic] [PSyAD] Change in operator index ordering does not match PSyAD's matmul standard #2774
Comments
This is related to #2766 |
This is a limitation of the Matmul2Code transformation: PSyclone/src/psyclone/psyir/transformations/intrinsics/matmul2code_trans.py Lines 261 to 271 in d865146
As the comment says, it should be possible to generalise it so that the ':'s appear at any location in the array reference. |
I'm thinking you might just be able to count the number of full range indices, if it's not equal to 2 then you throw a modified error message. If it is simple enough to get the number of matrix indices out then I don't mind having a go at this! Looks like |
This is just the validation. You will need to update the implementation too: PSyclone/src/psyclone/psyir/transformations/intrinsics/matmul2code_trans.py Lines 462 to 469 in d865146
We could take the opportunity to remove the requirement for full ranges too but I suggest that be a separate PR as it's not required to fix this problem (and presumably it needs fixing for 3.0?). |
I think the validation would still throw an error since the forward code will use operators that fail that validation. Of course, only fixing the validation ought to run into errors if it is only operating on For 3.0 it may be part of the work of #2766, so far I have only encountered this once when trying to use PSyAD but not sure how prevalent it is. It can be patched currently so it's less pressing but as always ideally does need to be fixed. |
For an array reference, the |
I don't think it should be part of #2766 (although may be required for it). It's a self-contained change to the transformation. |
Previously, an valid operator from PSyAD's perspective would be of the form
operator( : , : , idx )
, i.e.: the first two indices are full ranges. LFRic is now changing the index accessing to be likeoperator( idx, : , : )
which does not fit the standard imposed by PSyAD. This causes the following failure:The text was updated successfully, but these errors were encountered: