-
Notifications
You must be signed in to change notification settings - Fork 24.9k
[Inductor][CPP] Remove redundant Buffers after Grouped GEMM Fusion #143904
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
leslie-fang-intel
wants to merge
8
commits into
gh/leslie-fang-intel/176/base
from
gh/leslie-fang-intel/176/head
Closed
[Inductor][CPP] Remove redundant Buffers after Grouped GEMM Fusion #143904
leslie-fang-intel
wants to merge
8
commits into
gh/leslie-fang-intel/176/base
from
gh/leslie-fang-intel/176/head
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/143904
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 71d497a with merge base 744a303 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
sunjiweiswift
pushed a commit
to sunjiweiswift/pytorch
that referenced
this pull request
Jul 4, 2025
ghstack-source-id: f3c3ee0 Pull Request resolved: pytorch#143904
sunjiweiswift
pushed a commit
to sunjiweiswift/pytorch
that referenced
this pull request
Aug 1, 2025
ghstack-source-id: f3c3ee0 Pull Request resolved: pytorch#143904
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
module: inductor
open source
topic: not user facing
topic category
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Summary
In this PR, we remove the extra kernel arguments and the extra buffers allocation when any
MultiOutput Buffer
is consumed by an out-template epilogue. If anyMultiOutput Buffer
is consumed by an out-template epilogue, theGrouped GEMM Template
should bypass storing it in theMultiOutput Buffer
and instead write it directly to the corresponding out-template epilogue.Remove extra kernel arguments
For the case listed above, a
MultiOutput Buffer
shouldn't exist in the Kernel's args if it's consumed by an out-template epilogue. We mark thisMultiOutput Buffer
asREMOVED
for this case.Remove the extra buffers allocation
For the case listed above, a
MultiOutput Buffer
shouldn't be allocated. We introduce theoutputs_removed
attribute in theCppTemplateBuffer
. This attribute tracksMultiOutput Buffers
that are directly used by out-template epilogues. During code generation, if aMultiOutput Buffer
is listed inoutputs_removed
, its buffer allocation line is omitted to prevent unnecessary memory usage.Test Plan
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov