8000 [inductor] enable bf32 for mkldnn linear pointwise/binary in inductor by zhuhaozhe · Pull Request #127294 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[inductor] enable bf32 for mkldnn linear pointwise/binary in inductor #127294

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

Draft
wants to merge 54 commits into
base: gh/zhuhaozhe/33/base
Choose a base branch
from

Conversation

zhuhaozhe
Copy link
Collaborator
@zhuhaozhe zhuhaozhe commented May 28, 2024

When torch.backends.mkldnn.matmul.fp32_precision=='bf16', we also enabled mkldnn linear in inductor path and allow to run with bf16 computation data type.

Testplan:

python test/inductor/test_mkldnn_pattern_matcher.py -k test_linear_unary
python test/inductor/test_mkldnn_pattern_matcher.py -k test_linear_fp32
python test/inductor/test_mkldnn_pattern_matcher.py -k test_multi_linear_share_same_input

Stack from ghstack (oldest at bottom):

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @voznesenskym @penguinwu @EikanWang @Guobing-Chen @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang

Copy link
pytorch-bot bot commented May 28, 2024

🔗 Helpful Links

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

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

❌ 1 New Failure, 2 Unrelated Failures

As of commit ac9ed89 with merge base 4015166 (image):

NEW FAILURE - The following job has failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

[ghstack-poisoned]
@zhuhaozhe zhuhaozhe marked this pull request as draft May 28, 2024 14:01
@zhuhaozhe zhuhaozhe requested a review from jgong5 May 28, 2024 14:15
Comment on lines 786 to 790
if not hasattr(add_node.args[1], "meta"):
# May add an "int"
# We meet this issue while enabling bf32 for test_linear_unary
# the hardsimoid case will add "3" here and cannot check meta
# TODO: Further investigate on this issue
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it for the bias node or something else? Can you double check? Why didn't we get the problem in the past?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It should be another input node for "add".
We did not meet this in the past because we only enabled and tested lp for mkldnn fusion. For lp case, there will be a "to_dtype" inserted by autocast and will not match this pattern.

I am trying to find a case to satisfy this pattern by raising a runtime error if this function will return True.
#127597

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in #127597

zhuhaozhe added a commit that referenced this pull request May 30, 2024
[ghstack-poisoned]
[ghstack-poisoned]
zhuhaozhe added a commit that referenced this pull request Jun 4, 2024
[ghstack-poisoned]
zhuhaozhe added a commit that referenced this pull request Jun 5, 2024
[ghstack-poisoned]
@zhuhaozhe zhuhaozhe requested a review from jgong5 June 5, 2024 08:33
zhuhaozhe added a commit that referenced this pull request Jun 5, 2024
[ghstack-poisoned]
zhuhaozhe added a commit that referenced this pull request Jun 7, 2024
zhuhaozhe added a commit that referenced this pull request Aug 1, 2024
[ghstack-poisoned]
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 05:19 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 05:19 Inactive
yanbing-j pushed a commit that referenced this pull request Feb 6, 2025
[ghstack-poisoned]
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results February 6, 2025 08:33 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results February 6, 2025 08:33 Inactive
yanbing-j pushed a commit that referenced this pull request Feb 8, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request Feb 8, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request Mar 7, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request Mar 10, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request Mar 13, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request Mar 28, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request Apr 30, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request May 7, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request May 7, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request May 9, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request May 10, 2025
[ghstack-poisoned]
yanbing-j pushed a commit that referenced this pull request May 14, 2025
[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0