8000 [PT2E x86 & Intel GPU] Collapse dim in qlinear_pointwise_binary fusion by ZhiweiYan-96 · Pull Request #148245 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[PT2E x86 & Intel GPU] Collapse dim in qlinear_pointwise_binary fusion #148245

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

Conversation

ZhiweiYan-96
Copy link
Collaborator
@ZhiweiYan-96 ZhiweiYan-96 commented Mar 1, 2025

Motivation

Currently, most of qlinear+add path would hit fusion qlinear_pointwise_binary with sum as post op. But it has not collapse the input dim when dim>2. This PR intends to trigger dimension collapse in qlinear_bianry for 3D linear cases.

Stack from ghstack (oldest at bottom):

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov

[ghstack-poisoned]
Copy link
pytorch-bot bot commented Mar 1, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 6d893b0 with merge base 4216478 (image):

NEW FAILURE - The following job has failed:

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

ZhiweiYan-96 added a commit that referenced this pull request Mar 1, 2025
@ZhiweiYan-96 ZhiweiYan-96 marked this pull request as draft March 1, 2025 05:28
@ZhiweiYan-96 ZhiweiYan-96 added ciflow/xpu Run XPU CI tasks ciflow/trunk Trigger trunk jobs on your pull request labels Mar 1, 2025
@ZhiweiYan-96 ZhiweiYan-96 changed the title [PT2E] Collapse dim in qlinear_pointwise_binary fusion [PT2E x86& Intel GPU] Collapse dim in qlinear_pointwise_binary fusion Mar 1, 2025
@ZhiweiYan-96 ZhiweiYan-96 changed the title [PT2E x86& Intel GPU] Collapse dim in qlinear_pointwise_binary fusion [PT2E x86 & Intel GPU] Collapse dim in qlinear_pointwise_binary fusion Mar 1, 2025
@ZhiweiYan-96 ZhiweiYan-96 added the topic: not user facing topic category label Mar 1, 2025
@ZhiweiYan-96 ZhiweiYan-96 moved this to Review Required in PyTorch Intel Mar 1, 2025
@ZhiweiYan-96 ZhiweiYan-96 moved this from Review Required to Pre-Review Required in PyTorch Intel Mar 1, 2025
@ZhiweiYan-96 ZhiweiYan-96 added this to the 2.7.0 milestone Mar 1, 2025
@@ -884,7 +884,7 @@ def qlinear_binary(
x_size = x.get_size()
x2_size = x2.get_size()
assert len(x_size) == len(x2_size)
if len(x_size) > 2 and binary_attr == "add":
if len(x_size) > 2 and (binary_attr == "add" or binary_attr == "sum"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR. Can you elaborate on why this change is necessary? AFAIK, Viewing the input from 3D to 2D is required for the CPP GEMM Template, but the CPP GEMM Template doesn't support in-place sum yet. Adding a corresponding test case to illustrate this would also be appreciated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hi @leslie-fang-intel appreciation for you explanation. I just get the info that sum is not supported in CPP GEMM Template. I wrongly presume they have same ability previously. This PR is not necessary, I can adopt the dim collapsing logic in oneDNN integration for XPU instead. I will close this PR.

Thanks for your explanation again 👍 !

@github-project-automation github-project-automation bot moved this from Pre-Review Required to Done in PyTorch Intel Mar 3, 2025
@github-actions github-actions bot deleted the gh/ZhiweiYan-96/48/head branch April 2, 2025 02:11
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 ciflow/xpu Run XPU CI tasks module: inductor open source topic: not user facing topic category
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
0