Reduce Grouped MLP Fuser CPU Overhead - #3410
Open
zhongbozhu wants to merge 3 commits into
Open
Conversation
Reuse fused operation plans when full activation recompute changes grad mode, and avoid redundant CUDA current-device discovery for grouped MLP stream lookups. Co-authored-by: Ting-Yang Kao <tingyangk@nvidia.com> Signed-off-by: Zhongbo Zhu <zhongboz@nvidia.com>
Signed-off-by: Zhongbo Zhu <zhongboz@nvidia.com>
zhongbozhu
marked this pull request as ready for review
August 20, 2026 18:39
Collaborator
Author
|
/te-ci pytorch L1 |
Contributor
Greptile SummaryThe PR reduces grouped-MLP fuser CPU overhead by reusing fusion plans across alternating checkpoint-forward and recomputation modes and by avoiding redundant CUDA device discovery.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["maybe_fuse_ops invocation"] --> B["Determine backward boundary"]
B --> C{"Recipe state changed?"}
C -- Yes --> D["Reset basic-op recipe state"]
C -- No --> E["Build fusion cache key"]
D --> E
E --> F{"Cached plan exists?"}
F -- Yes --> G["Restore cached forward/backward lists"]
F -- No --> H["Apply fusion passes"]
H --> I["Cache resulting plan"]
G --> J["Execute selected plan"]
I --> J
Reviews (4): Last reviewed commit: "fix cutedsl wgrad crash" | Re-trigger Greptile |
vthumbe1503
reviewed
Aug 20, 2026
| # backward boundary in the key, but pay construction cost only once for | ||
| # each configuration. Full recompute therefore builds at most one | ||
| # no-grad plan and one grad-enabled plan for a stable recipe. | ||
| fusion_params = (recipe_type, first_op_requiring_backward, backward_override) |
Collaborator
There was a problem hiding this comment.
I think we should use recipe object instead of recipe_type as fusion_param key And implement hash function for it. Since that governs the fusion and not just the recipe type
cc: @timmoon10
tingyangk
force-pushed
the
opfuser_group_mlp_cpu_optim
branch
from
August 22, 2026 00:54
fdf7e0e to
ff86f24
Compare
Signed-off-by: tingyangk <tingyangk@nvidia.com>
tingyangk
force-pushed
the
opfuser_group_mlp_cpu_optim
branch
from
August 22, 2026 02:00
ff86f24 to
97850a4
Compare
Collaborator
Author
|
/te-ci pytorch L1 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Reuse fused operation plans when full activation recompute changes grad mode, and avoid redundant CUDA current-device discovery for grouped MLP stream lookups.
Fixes # (issue)
#2897
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: