Skip to content
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

DynamicUpdateSliceOp reverse derivative #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pangoraw
Copy link
Collaborator

@Pangoraw Pangoraw commented Nov 8, 2024

No description provided.

@mofeing
Copy link
Collaborator

mofeing commented Nov 8, 2024

Great! But I think it was doable in TableGen?

I almost have it like this:

def : HLOMemoryIdentityOp<"DynamicUpdateSliceOp", [], [0, 1], (Op $operand, $update, $start_indices), [
  (DynamicUpdateSlice (DiffeRet), (BroadcastInDim (HLOConstantFP<"0"> /* eltype($operand) */), /* size($update) */), $start_indices),  //  { DiffeRet[start_indices...] = fill(0); return DiffeRet; }
  (DynamicSlice (DiffeRet), $start_indices, /* size($update) */), // DiffeRet[start_indices...]
  (AssertingInactiveArg),
]>;

and the remaining parts are easy to add with a GlobalExpr

@Pangoraw
Copy link
Collaborator Author

Pangoraw commented Nov 8, 2024

I am not sure how to handle the variadic indices in tablegen.

@mofeing
Copy link
Collaborator

mofeing commented Nov 8, 2024

I've checked out and apparently Variadic is an object so you don't have a variadic number of arguments but 1 argument with variadic number of elements (like Vararg in Julia).

So just putting that AssertingInactiveArg should be enough (if I understand correctly that command).

@Pangoraw
Copy link
Collaborator Author

Pangoraw commented Nov 8, 2024

Note that if we keep the cpp version, I should add conjugates

@mofeing
Copy link
Collaborator

mofeing commented Nov 8, 2024

do you mean complex conjugates? if so, why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants