-
Notifications
You must be signed in to change notification settings - Fork 982
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
Make CuTe and PyCuTe idx2crd Behaviors The Same #1891
base: main
Are you sure you want to change the base?
Conversation
I actually recommend removing This python implementation of |
In the case of removal of |
I did not define Just let me know your decisions. BTW, why the PyCuTe functions are not Python bindings to the CuTe C++ functions? |
You simply can't do it in general (without solving certain Diophantine equations...). Obviously it's not even unique for any layout with a stride-0.
Yes, but those cases need to be consistent as well else you run into problems in defining
It was a playful alternate implementation that got released for some reason. I still use it for prototyping or code golfing once in a while, but that's it. |
Having a fully functional PyCuTe support same as CuTe C++ will be extremely useful.
So the layout operator will take me from coordinate space to index space, is there a reliable way in CuTe C++ to go in the reverse direction from index space to coordinate space? Does CuTe C++ solve Diophantine equations? |
No, there is no fully reliable way to go from index space to coordinate space. We now use Coordinate Tensors to track and manipulate coordinate spaces. This is how we perform predication generically among other applications. See |
@ccecka So I guess my action item is to define |
This PR has been labeled |
CuTe C++ has two function overloadings for
idx2crd
:However, PyCuTe only has one function for
idx2crd
:If default value
None
if used for theidx2crd(idx, shape, stride=None)
in PyCuTe, the function behavior is different from thecrd2idx(Coord const& coord, Shape const& shape)
in CuTe C++.Therefore, a new function
idx2crd(idx, shape)
was added to PyCuTe, and the default value was removed fromidx2crd(idx, shape, stride=None)
.