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

[HIPIFY][feature] Add a new function call transformation type "move arg from place X to place Y" #830

Closed
emankov opened this issue Apr 5, 2023 · 1 comment
Assignees
Labels
feature Feature request or implementation

Comments

@emankov
Copy link
Collaborator

emankov commented Apr 5, 2023

  • Move transformation can be multiple in a single function
  • For instance, cudnnSoftmaxForward -> miopenSoftmaxForward_V2: move args: 1 -> 7, 2 -> 8
@emankov emankov added the feature Feature request or implementation label Apr 5, 2023
@emankov emankov self-assigned this Apr 5, 2023
emankov added a commit to emankov/HIPIFY that referenced this issue Apr 23, 2023
…rg from place X to place Y"

[feature]
+ Support for multiple transformations for a single call (including different types of transformations)
+ Support for a batch move of a sequence of args
+ Swap transformation should be described as two move transformations; for instance, for swapping 1 <-> 2 there should be two moves: 1->2 and 2->1; the order doesn't matter

[IMP]
+ Instead of moving multiple arguments to the same place (including the very end), a batch move should be used
+ For instance:
        {1, {e_move_argument, cw_None, "", 9}},
        {2, {e_move_argument, cw_None, "", 9}},
  should be replaced with:
        {1, {e_move_argument, cw_None, "", 9, 2}},
  That means that two args starting from 1st (1st and 2nd) will be moved to the end of the function call in the same order in a single replacement step
+ [Reason]
  1 -> 9 and 2->9 are order-dependent, and argument 1 at place 9 will be rewritten by argument 2 or vice versa, whereas both are needed to be moved at place 9

[MIOpen][fix]
+ Apply move transformation for the following function calls:
  cudnnSoftmaxForward, cudnnSoftmaxBackward, cudnnConvolutionForward, cudnnConvolutionBackwardData, cudnnRNNBackwardWeights, cudnnGetConvolutionForwardWorkspaceSize, cudnnGetConvolutionBackwardDataWorkspaceSize
+ Update the test cudnn2miopen.cu accordingly
emankov added a commit that referenced this issue Apr 23, 2023
[HIPIFY][#830][feature] Function call transformation type "move arg from place X to place Y"
@emankov
Copy link
Collaborator Author

emankov commented Apr 23, 2023

Implemented by #846

[feature]

  • Support for multiple transformations for a single call (including different types of transformations)
  • Support for a batch move of a sequence of args
  • Swap transformation should be described as two move transformations; for instance, for swapping 1 <-> 2 there should be two moves: 1->2 and 2->1; the order doesn't matter

[IMP]

  • Instead of moving multiple arguments to the same place (including the very end), a batch move should be used
  • For instance:
{1, {e_move_argument, cw_None, "", 9}},
{2, {e_move_argument, cw_None, "", 9}}, 

should be replaced with:

{1, {e_move_argument, cw_None, "", 9, 2}},

That means that two args starting from 1st (1st and 2nd) will be moved to the end of the function call in the same order in a single replacement step

[Reason] 1 -> 9 and 2->9 are order-dependent, and argument 1 at place 9 will be rewritten by argument 2 or vice versa, whereas both are needed to be moved at place 9

@emankov emankov closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or implementation
Projects
None yet
Development

No branches or pull requests

1 participant