8000 Set prop_kind to forward_inference when grad is not needed for mkldnn_convolution_pointwise by CaoE · Pull Request #142855 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Set prop_kind to forward_inference when grad is not needed for mkldnn_convolution_pointwise #142855

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 1 commit into from

Conversation

CaoE
Copy link
Collaborator
@CaoE CaoE commented Dec 11, 2024

prop_kind of MKLDNN convolution is always dnnl_forward, i.e., dnnl_forward_training , regardless of whether grad is needed. Setting prop_kind to dnnl_forward_inference for mkldnn_convolution_pointwise could have better performance.

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10

Copy link
pytorch-bot bot commented Dec 11, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 3bf97f7 with merge base 30d8b30 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Dec 11, 2024
@CaoE CaoE added topic: not user facing topic category ciflow/trunk Trigger trunk jobs on your pull request ciflow/inductor and removed module: cpu CPU specific problem (e.g., perf, algorithm) labels Dec 11, 2024
@pytorch-bot pytorch-bot bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Dec 11, 2024
@CaoE CaoE force-pushed the conv_opt branch 2 times, most recently from 29c0d06 to f64c22f Compare December 25, 2024 05:40
@CaoE CaoE changed the title Set prop_kind to forward_inference when grad is not needed for MKLDNN convolution Set prop_kind to forward_inference when grad is not needed for mkldnn_convolution_pointwise Dec 25, 2024
@CaoE CaoE requested a review from jgong5 December 25, 2024 07:44
Copy link
Collaborator
@jgong5 jgong5 left a comment

Choose a reason for hiding this comment

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

Why does the perf would be different?

@CaoE
Copy link
Collaborator Author
CaoE commented Dec 26, 2024

Why does the perf would be different?

Compared with dnnl_forward_training , dnnl_forward_inference may be dispatched to different implementations and uses different weights layouts.
The measurement found that convolution has an improvement of about 2-3% on some models.

@CaoE CaoE requested review from mingfeima and jgong5 January 7, 2025 08:48
@CaoE CaoE marked this pull request as ready for review January 8, 2025 02:13
@CaoE CaoE requested a review from cpuhrsch January 8, 2025 02:14
@CaoE
Copy link
Collaborator Author
CaoE commented Jan 8, 2025

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) open source topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0