-
Notifications
You must be signed in to change notification settings - Fork 49
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
Slice python api #2932
base: main
Are you sure you want to change the base?
Slice python api #2932
Conversation
Do you have any plan to update the composite operation API at https://github.com/NVIDIA/Fuser/blob/main/csrc/ops/alias.h#L119-L136? It only takes |
Nope. I can just use the very first overload with |
Val* start_idx = start.at(idx); | ||
Val* end_idx = end.at(idx); | ||
Val* stride_idx = stride.at(idx); | ||
NVF_CHECK( |
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.
These checks are now inside finalizeDefinition
instead of on the constructor. Hence exposes the issue on our FusionCache #2953
!build |
!build |
!build |
!build |
!build |
!build |
Updating
FusionDefinition.ops.slice
to take dynamic Val as slice arguments. Three overload is supported:fd.ops.slice(T0, start=[S0, S1], end=[S2, S3])
fd.ops.slice(T0, start=(S0, S1), end=(S2, S3))
V0 = fd.define_vector(2)
V1 = fd.define_vector(2)
fd.ops.slice(T0, start=V0, end = V1)
Note that we currently don't yet support mixing the argument type, i.e.
fd.ops.slice(T0, start=[S0, S1], end=V1)
will error out.Before this PR, slice requires all args to be constant python number. This PR allows us to have dynamic slice behavior, since we can use
Val
/Vector
in slice now.