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][#830][feature] Function call transformation type "move arg from place X to place Y" #846

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

emankov
Copy link
Collaborator

@emankov emankov commented Apr 23, 2023

[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, and cudnnGetConvolutionForwardWorkspaceSize, cudnnGetConvolutionBackwardDataWorkspaceSize
  • Update the test cudnn2miopen.cu accordingly

…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 emankov added feature Feature request or implementation MIOpen labels Apr 23, 2023
@emankov emankov requested a review from searlmc1 April 23, 2023 18:29
@emankov emankov self-assigned this Apr 23, 2023
@emankov emankov merged commit 36293ef into ROCm:amd-staging 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 MIOpen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant