Repository navigation
Rely on Recipe object for fusion - #3717
Conversation
…the grouped tensor path Signed-off-by: Varun Thumbe <vthumbe@nvidia.com>
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryThe PR selects fusion plans using the recipe string and the backward boundary.
No new actionable issues were found. The previous GPU-cache, grouped-MLP flag, and repeated-settings findings are addressed. Review checks were based on source inspection; tests were not run. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Recipe and backward boundary] --> B[Check existing recipe-state reset conditions]
B --> C[Build key from recipe string and backward boundary]
C --> D{Cached plan?}
D -->|Yes| E[Reuse forward and backward plans]
D -->|No| F[Apply fusion rules]
F --> G[Cache forward and backward plans]
Reviews (9) · Last reviewed commit: "Merge branch 'main' into recipe_hash" · Reviewed by Greptile |
There was a problem hiding this comment.
Do you mean merge conflict? or design conflict? If it is the latter could you explain how?
There was a problem hiding this comment.
That PR adds infrastructure for the recipe to create nested tuples that describe its config, which are easier to compare than the recipes themselves. This PR uses the string representation to do something similar. I like this PR's approach more.
Signed-off-by: Varun Thumbe <vthumbe@nvidia.com>
Signed-off-by: Varun Thumbe <vthumbe@nvidia.com>
6e88f7e to
163015f
Compare
Signed-off-by: Varun Thumbe <vthumbe@nvidia.com>
|
/te-ci pytorch |
Signed-off-by: Varun Thumbe <vthumbe@nvidia.com>
timmoon10
left a comment
There was a problem hiding this comment.
Overall LGTM, with some minor suggestions.
Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: vthumbe1503 <vthumbe@nvidia.com>
Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: vthumbe1503 <vthumbe@nvidia.com>
Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: vthumbe1503 <vthumbe@nvidia.com>
|
/te-ci pytorch |
|
Pipeline 77096236 |
Description
Use the recipe's string representation to select an operation-fusion plan. The previous cache key used the recipe type, backward boundary, and backward override, so a change to another setting on the same recipe type could reuse a plan chosen for the old settings. The new key uses
str(recipe)and the backward boundary. Recipe classes describe their own settings;OperationFuserdoes not need a growing list of MXFP8, NVFP4, or grouped-MLP recipe options to decide when to re-evaluate fusion.Recipe representations are cached and invalidated when attributes change. Unexpected public attributes are included too, so changing the dynamically attached
enable_cutedsl_fused_grouped_mlpflag changes the fusion key. The NVFP4 representation now also includesdisable_rht.This follows the motivation in the original discussion.
Type of change
Changes
str(recipe)and the first operation requiring backward. Keep fusion-plan selection separate from the existing recipe-state reset conditions.CPU overhead of grouped-tensor support checks
BF16 with no recipe on a dlcluster GB200, using
cuda:0explicitly. Values are median CPU time per call over nine runs of 200,000 calls; the cached path was warm. The uncached functions came from this PR's base commit (491d557), and the device-key code is in793c5ac.These numbers use the explicit-device path taken by the internal callers. Omitting
devicerequires querying the current CUDA device on each call and has different CPU cost. No GPU kernel changes are included.Scope of recipe updates
The fusion-plan cache and quantizer-state reset are separate. This PR changes plan selection; it does not rebuild quantizers when a same-type recipe update changes their configuration. Dynamic recipe update handling is being addressed in PR #3343.
Checklist