Repository navigation
Reduce CPU overhead in graph-safe GroupedLinear/GroupedMLP - #3752
Conversation
Signed-off-by: Varun Thumbe <vthumbe@nvidia.com>
c67067c to
5885336
Compare
for more information, see https://pre-commit.ci
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThis PR reduces repeated Python work around graph-safe grouped linear and MLP calls.
No actionable issues were found. Review used the full PR changes because the previous and current heads have different merge bases with the supplied target commit. No runtime tests were run. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Contiguous input and gradient buffers] --> B[Grouped storage keeps existing shapes]
B --> C[C++ reads pointers and grouped metadata]
C --> D[Grouped GEMM]
B --> E[Split requested]
E --> F[Flatten shared views]
F --> G[Slice individual tensors]
Reviews (4) · Last reviewed commit: "Merge branch 'main' into grouped-linear-..." · Reviewed by Greptile |
|
/te-ci pytorch |
| # for all of fprop/dgrad/wgrad, so no user-configurable setting is discarded. | ||
| # On Blackwell and newer the binding emulates this GEMM with MXFP8 (as for | ||
| # non-grouped GEMM); the setting is passed through unchanged. | ||
| use_split_accumulator = True |
There was a problem hiding this comment.
Honestly at this point, I don't think anyone wants to use use_split_accumulator=False even for per-tensor recipe.
Setting use_split_accumulator=False was a legacy toggle used back in the delayed scaling days or per-tensor current scaling, and we sometimes tuned it off and trade GEMM-K accumulation precision for more GEMM perf. But I don't think anyone is gonna do that anymore, plus that everyone using fp8 recipe on Hopper uses blockwise and they expect fp32 accumulation precision.
use_split_accumulator=False is also Hopper-only, it's not applicable for Blackwell anymore.
I would suggest we remove everything about use_split_accumulator=False because it delivers more precision by default.
Signed-off-by: Varun Thumbe <vthumbe@nvidia.com>
|
/te-ci pytorch |
Description
Reduce CPU host overhead in graph-safe GroupedLinear and grouped MLP training steps. The measured CUDA kernels and their total durations are unchanged.
Type of change
Changes
main.split_into_quantized_tensorsslices storage; add coverage for multidimensional contiguous buffers.Performance
CPU host step time, forward plus backward, lower is better.
mainisdd628d3a11;PRis96dd4c060e. Values are medians of six 400-step blocks across two interleaved passes (main, PR,main, PR) on the same GB200/Grace node, pinned to CPU 16. Each process had 60 warmup steps. The workload uses eight experts, 256 tokens per expert, hidden size 128, discrete expert weights, and no bias. BF16 uses BF16 activations and weights without FP8 autocast; MXFP8 uses BF16 activations with the MXFP8 block-scaling recipe. Timings exclude a per-step CUDA synchronization. The fused MXFP8 MLP uses split alignment 256; the otherSequentialcases use 128.These measurements predate the merge of
maininto PR head08008c8445on 2026-11-02. The merged head has not been remeasured because dlcluster was unreachable.BF16
SequentialMXFP8
SequentialSequential