[PyTorch] Propagate FP8 graph weight update flag in GroupedLinear#3052
[PyTorch] Propagate FP8 graph weight update flag in GroupedLinear#3052allenphilipj wants to merge 3 commits into
Conversation
937ef34 to
80304fa
Compare
Greptile SummaryThis PR fixes a missing propagation of the FP8 CUDA-graph weight-update skip flag (
Confidence Score: 5/5Safe to merge — the change is a narrow, targeted fix that replaces a hard-coded None with the tensor already managed by sibling modules using the identical three-line pattern. The diff is a direct copy of the same guard block from Linear/LayerNormLinear/LayerNormMLP. The non_tensor_args tuple layout in GroupedLinear already had a slot for skip_fp8_weight_update (previously always None), so no downstream unpacking changes are needed. The regression test validates both the tensor propagation and the is_first_microbatch override in a single focused call path. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant GroupedLinear
participant FP8GlobalStateManager
participant _GroupedLinear
Caller->>GroupedLinear: "forward(inp, m_splits, is_first_microbatch=True)"
GroupedLinear->>FP8GlobalStateManager: fp8_graph_capturing()
alt CUDA graph capture active
FP8GlobalStateManager-->>GroupedLinear: True
GroupedLinear->>FP8GlobalStateManager: quantization_state.skip_fp8_weight_update_tensor
FP8GlobalStateManager-->>GroupedLinear: Tensor (or None)
alt tensor is not None
GroupedLinear->>GroupedLinear: "is_first_microbatch = False"
end
else Normal execution
FP8GlobalStateManager-->>GroupedLinear: False
GroupedLinear->>GroupedLinear: "skip_fp8_weight_update = None"
end
GroupedLinear->>_GroupedLinear: "forward(..., non_tensor_args[18]=skip_fp8_weight_update, ...)"
_GroupedLinear-->>GroupedLinear: out, new_workspaces
GroupedLinear-->>Caller: out
Reviews (6): Last reviewed commit: "Merge branch 'main' into codex-grouped-l..." | Re-trigger Greptile |
|
/te-ci pytorch |
Signed-off-by: allenphilipj <allenphilipj@users.noreply.github.com>
d7a4caa to
1890acf
Compare
|
@ksivaman I've rebased on the latest main & resolved the conflicts, would much appreciate a follow-up review. |
Summary:
Validation:
Fixes #3051