-
Notifications
You must be signed in to change notification settings - Fork 22
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
Revert PR#222 with incorrect fix for #218 #249
base: main
Are you sure you want to change the base?
Conversation
…ads for transposed and scaled inputs kokkos#218" This reverts commit 098f6ef.
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'll leave this up to @crtrott , who is more familiar with the customization design.
where is your comment in the issue? it disappeared? |
@fnrizzi wrote:
I deleted the comment, because it wasn't accurate. Never mind : - ) Christian and I are discussing the solution now. |
Basically the infinite recursion should only happen if the specialization (i.e. the Kokkos variant) isn't more special than the generic one which is completely unconstrained on the ExecPolicy see https://godbolt.org/z/7x5hhne8o Basically the specialized implementation needs to have the same constraints as the entry function (i.e. you need to take the mdspans as mdspans and be templated on all the other things). In that way this won't recurse. |
I was going to say I agree with differentiating names, and in fact I brought it up a while back, but was kind of "not a pressing issue" at that time I guess. why is ADL a better solution? |
@fnrizzi Just to clarify: Christian and I did some investigation, and we think the actual issue could be that your custom |
yes, ok, i see it could be the case also from what Christian said. But this being said, I don't quite understand why not using a different name? Effectively, this would also express better(IMO) the intent since one is writing an implementation of the stdlinalg and those impl functions should in theory not even be used directly. That would take away all issues and it seems to me that relying on ADL and the fact that customizations must be constrained enough/well is a kind of a delicate thing, very easy to mess up. I do get that it has to be done once, but still, any small change can inadvertently break this. |
@fnrizzi wrote:
Users want to customize algorithms like Choosing a different name for the customization point than the function would prevent infinite recursion issues like #218. However, it wouldn't prevent other issues. For example, if users implementing a customization don't constrain its parameters correctly or provide the wrong number of parameters, then the compiler might silently ignore the customization. P2279 has a survey of different customization approaches. It explains the different ways that each of them can go wrong, and argues for a language solution. P2547 is an example of a proposed language solution. I wouldn't object to making the customization points have different names. However, this would be a breaking change, yet it would only solve one of the many issues with relying on ADL as a customization mechanism. If we plan to make a breaking change, then we might want to consider adopting a different approach for customization. |
@mhoemmen yes thanks for those links, very useful :) I will read them. Re "However, it wouldn't prevent other issues. For example, if users implementing a customization don't constrain its parameters correctly or provide the wrong number of parameters, then the compiler might silently ignore the customization." Yea totally agree! the naming would at least prevent one issue which was IMO a tricky one. I was actually reasoning from the assumption that the customization mechanism was "decided" except for the naming... if the way we customize can be changed or discussed then this changes things. At least changes where I start to think from :) |
@fnrizzi wrote:
Just to clarify: the customization mechanism is not part of the proposal P1673. It's specific to this implementation of the proposal. Thus, it can be changed independently of the proposal. |
This PR reverts #222 (commit 098f6ef) with partial fix for #218:
the implementation was found out to be incorrect - see #248 and #218 for more details.