Add SM100 CuTe DSL GRPO fast path - #1363
Open
Celaena24 wants to merge 7 commits into
Open
Conversation
Use the reusable PR linkedin#1339 row-reduction GEMM for fused-linear selective log probabilities and their backward pass on B200-class GPUs. Preserve the existing path as the fallback for unsupported inputs.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Include the isolated B200 latency, memory, and improvement plots for the draft PR analysis.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rebuild selective log-probability on the final merged SM100 GEMM and cross-entropy primitives. Use a full 1024-row workspace, direct log-probability output, and first-gradient ownership to improve B200 full latency by 9-15% while preserving bounded memory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use FP32 only when selective-logprob backward spans multiple logits chunks, then cast once to the weight dtype. Add regression coverage for the accumulation buffer dtype. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate the B200 latency, peak-memory, and improvement-ratio plots from the final merged-compatible optimized implementation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kolehma8
reviewed
Aug 10, 2026
|
|
||
| @staticmethod | ||
| @amp_custom_fwd | ||
| def forward(ctx, _input, weight, target, bias=None, temperature=1.0): |
Collaborator
There was a problem hiding this comment.
I think we should follow the same signature from the current fused linear ppo for this.
Contributor
Author
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.
Summary
1.0.Why it is faster and uses less memory
Together, these changes explain the roughly 9-10x lower latency and about 2 GiB lower peak memory in the B200 benchmark.
B200 results
NVIDIA B200 (SM100), BF16,
T=1024,H=4096,V=128256. Values include policy and reference log-probabilities, GRPO loss math, and backward.Compared with the first merged-compatible implementation, the final optimization lowers token-level full latency by 9.0-14.3% and sequence-level full latency by 11.2-14.7%, with peak memory staying within 2.4%.
PyTorch
2.13.0.1hits a Dynamo shape-guard bug in the benchmark's compiled loss-only section, so both baseline and CuTe DSL measurements usedTORCHDYNAMO_DISABLE=1for an equal kernel-path comparison.Native scope
(10, 0)1.0Unsupported inputs delegate to the existing
_ChunkedSelectiveLogProbFunction.Validation
1094 passed, 631 skipped— CuTe DSL, chunked GRPO, and low-level GRPO suitesmake checkstylePerformance plots
Latency and peak memory
Improvement ratios