8000 [inductor] add conv_transpose2d unary fusion for cpu in inference mode by chunyuan-w · Pull Request #90265 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[inductor] add conv_transpose2d unary fusion for cpu in inference mode #90265

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

Closed
wants to merge 13 commits into from

Conversation

chunyuan-w
Copy link
Collaborator
@chunyuan-w chunyuan-w commented Dec 6, 2022

Stack from ghstack (oldest at bottom):

An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

  • relu
  • sigmoid
  • tanh
  • hardswish
  • leaky_relu
  • hardtanh
  • gelu

cc @mlazos @soumith @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire

@pytorch-bot
Copy link
pytorch-bot bot commented Dec 6, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/90265

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 Failures

As of commit 88e7c73:

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

…ference mode"

cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
@@ -3411,6 +3411,70 @@ def _prepare_convolution_fusion_create(
return inputs, constant_args, kernel_layout, req_stride_order


def _prepare_convolution_transpose_fusion_create(
cls,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we combine this code with convolution?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the code to reuse the _prepare_convolution_fusion_create function for ConvTranspose.

…ference mode"

cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
[1, 3],
[1, 2],
[1, 4],
[0],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this c 8000 omment to others. Learn more.

Cover non-zero padding as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed padding from [0] to [0, 1] to covert the non-zero padding case.

@chunyuan-w chunyuan-w marked this pull request as ready for review December 9, 2022 08:01
…ference mode"

cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
chunyuan-w added a commit to chunyuan-w/pytorch that referenced this pull request Dec 13, 2022
…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
@chunyuan-w chunyuan-w added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 15, 2022
…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
@chunyuan-w
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
@ezyang
Copy link
Contributor
ezyang commented Dec 17, 2022

@pytorchbot revert -c ghfirst -m "earlier pr on stack got yanked, this one needs to go too"

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator 6D40

@chunyuan-w your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Dec 17, 2022
…ence mode (#90265)"

This reverts commit d6fe983.

Reverted #90265 on behalf of https://github.com/ezyang due to earlier pr on stack got yanked, this one needs to go too
@chunyuan-w chunyuan-w reopened this Dec 19, 2022
…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
…ference mode"



An FX transformation is added to fuse ConvTranspose2d with eltwise OPs in torchinductor for CPU in inference mode, following the implementation in #87063.

The fusion OP is implemented in #90264 and will be treated as an extern kernel call in torchinductor.

The fusion of ConvTranspose2d with the below OPs is supported:

- relu
- sigmoid
- tanh
- hardswish
- leaky_relu
- hardtanh
- gelu


cc mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
@chunyuan-w
Copy link
Collaborator Author

Re-opened in #91954

@chunyuan-w chunyuan-w closed this Jan 11, 2023
chunyuan-w added a commit that referenced this pull request Jan 18, 2023
…ose2d unary fusion for cpu in inference mode"


Re-land #90265.
Depend on internal ideep upgrade.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
chunyuan-w added a commit that referenced this pull request Jan 18, 2023
…on for cpu in inference mode"


Re-land #90265.
Depend on internal ideep upgrade.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
chunyuan-w added a commit that referenced this pull request Jan 31, 2023
…ose2d unary fusion for cpu in inference mode"


Re-land #90265.
Depend on internal ideep upgrade.
[Update]: internal ideep upgrade issue is resolved in #92239.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
chunyuan-w added a commit that referenced this pull request Jan 31, 2023
…on for cpu in inference mode"


Re-land #90265.
Depend on internal ideep upgrade.
[Update]: internal ideep upgrade issue is resolved in #92239.

cc jgong5 mingfeima XiaobingSuper sanchitintel ashokei jingxu10 mlazos soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang Guobing-Chen zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Jan 31, 2023
…in inference mode (#91954)

Re-land #90265.
Depend on internal ideep upgrade.
[Update]: internal ideep upgrade issue is resolved in #92239.

Pull Request resolved: #91954
Approved by: https://github.com/jgong5, https://github.com/desertfire
@facebook-github-bot facebook-github-bot deleted the gh/chunyuan-w/16/head branch June 8, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants
0