Add the getter and setter of skip_fp8_weight_update_tensor#3015
Add the getter and setter of skip_fp8_weight_update_tensor#3015xrennvidia wants to merge 6 commits into
Conversation
Signed-off-by: Xiaowei Ren <xren@nvidia.com>
for more information, see https://pre-commit.ci
Greptile SummaryThis PR restores the
Confidence Score: 5/5Safe to merge — the change is a minimal, additive restoration of two accessor methods with no behaviour changes to existing call sites. Both new methods encapsulate logic that was already present and tested inline in No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant MCore as MCore / graph.py
participant Manager as FP8GlobalStateManager
participant State as FP8GlobalState
MCore->>Manager: set_skip_fp8_weight_update_tensor(False)
Manager->>State: skip_fp8_weight_update_tensor is None?
alt tensor is None
Manager->>State: create torch.empty(1, float32, cuda)
end
Manager->>State: fill_(False)
MCore->>Manager: get_skip_fp8_weight_update_tensor()
Manager->>State: read skip_fp8_weight_update_tensor
State-->>Manager: Optional[Tensor]
Manager-->>MCore: Optional[Tensor]
Reviews (5): Last reviewed commit: "Merge branch 'main' into xren/fix_skip_f..." | Re-trigger Greptile |
return type fix Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Xiaowei Ren <103958965+xrennvidia@users.noreply.github.com>
ptrendx
left a comment
There was a problem hiding this comment.
I believe there could be a reason why Pawel removed those functions from this object and we may need to change MCore instead in order to have this be compatible with torch.compile. Setting 'request changes' status for now until @pggPL reviews it.
pggPL
left a comment
There was a problem hiding this comment.
LGTM
I didn't know that this is used in mcore, I've run the torch compile test with this code and it also passes.
|
/te-ci pytorch |
|
/te-ci pytorch |
Description
The getter and setter of
skip_fp8_weight_update_tensorwere deleted in @pggPL 's PR2759, but MCore local Cuda Graph implementation still needs it (like here), so create this PR to recover it back.Type of change
Changes
Please list the changes introduced in this PR:
Checklist: