【KernelGen】Add rsub operator - #1761
Merged
Merged
Conversation
Schopenhauer-loves-Hegel
requested review from
0x45f,
huangyiqun,
kiddyjinjin and
zhangpeiyang1
as code owners
February 27, 2026 06:18
Collaborator
Author
|
Closing in favor of grouped PRs to reduce review overhead. |
Contributor
Benchmark Results for
|
| Torch (ms) | Gems (ms) | Speedup | Size |
|---|---|---|---|
| 14.59 | 16.11 | 0.906 | [1073741824] |
| 0.007 | 0.008 | 0.878 | [64,64] |
| 0.085 | 0.089 | 0.964 | [4096,4096] |
| 0.086 | 0.089 | 0.965 | [64,512,512] |
| 13.32 | 17.02 | 0.782 | [1024,1024,1024] |
| 0.007 | 0.008 | 0.905 | [1024,1] |
| 0.008 | 0.008 | 0.967 | [1024,16] |
| 0.009 | 0.010 | 0.877 | [1024,256] |
| 0.028 | 0.030 | 0.930 | [1024,4096] |
| 0.305 | 0.312 | 0.979 | [1024,65536] |
| 0.007 | 0.008 | 0.873 | [64,64,1] |
| 0.008 | 0.007 | 1.122 | [64,64,16] |
| 0.012 | 0.014 | 0.879 | [64,64,256] |
| 0.085 | 0.088 | 0.975 | [64,64,4096] |
| 5.14 | 7.53 | 0.683 | [64,64,65536] |
float32
| Torch (ms) | Gems (ms) | Speedup | Size |
|---|---|---|---|
| 24.30 | 30.52 | 0.796 | [1073741824] |
| 0.007 | 0.008 | 0.923 | [64,64] |
| 0.157 | 0.159 | 0.987 | [4096,4096] |
| 0.158 | 0.158 | 0.996 | [64,512,512] |
| 40.02 | 41.85 | 0.956 | [1024,1024,1024] |
| 0.008 | 0.008 | 1.000 | [1024,1] |
| 0.007 | 0.007 | 0.998 | [1024,16] |
| 0.010 | 0.011 | 0.922 | [1024,256] |
| 0.047 | 0.048 | 0.987 | [1024,4096] |
| 0.602 | 0.597 | 1.008 | [1024,65536] |
| 0.007 | 0.008 | 0.909 | [64,64,1] |
| 0.008 | 0.008 | 1.042 | [64,64,16] |
| 0.017 | 0.017 | 0.979 | [64,64,256] |
| 0.158 | 0.158 | 0.996 | [64,64,4096] |
| 2.38 | 2.35 | 1.012 | [64,64,65536] |
bfloat16
| Torch (ms) | Gems (ms) | Speedup | Size |
|---|---|---|---|
| 13.41 | 16.42 | 0.817 | [1073741824] |
| 0.007 | 0.008 | 0.878 | [64,64] |
| 0.086 | 0.089 | 0.966 | [4096,4096] |
| 0.086 | 0.089 | 0.965 | [64,512,512] |
| 13.41 | 16.42 | 0.817 | [1024,1024,1024] |
| 0.008 | 0.007 | 1.169 | [1024,1] |
| 0.007 | 0.008 | 0.858 | [1024,16] |
| 0.009 | 0.010 | 0.902 | [1024,256] |
| 0.028 | 0.030 | 0.925 | [1024,4096] |
| 0.306 | 0.312 | 0.979 | [1024,65536] |
| 0.007 | 0.007 | 0.989 | [64,64,1] |
| 0.008 | 0.009 | 0.953 | [64,64,16] |
| 0.012 | 0.014 | 0.898 | [64,64,256] |
| 0.085 | 0.089 | 0.958 | [64,64,4096] |
| 4.88 | 5.29 | 0.923 | [64,64,65536] |
Overall: median speedup ~0.96x, mean ~0.94x — performance is on par with PyTorch, as expected for a simple pointwise op.
tengqm
reviewed
Apr 19, 2026
tengqm
reviewed
Apr 20, 2026
tengqm
reviewed
Apr 20, 2026
tengqm
reviewed
Apr 20, 2026
factnn
requested review from
bin913,
douxetpur and
w1120029931-bit
as code owners
April 26, 2026 06:49
tengqm
reviewed
Apr 26, 2026
tengqm
reviewed
Apr 26, 2026
tengqm
reviewed
Apr 26, 2026
tengqm
reviewed
Apr 26, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
UT ResultsBranch rebased to upstream/master and tests passed: |
bin913
approved these changes
May 9, 2026
withdrawn919
pushed a commit
to withdrawn919/FlagGems
that referenced
this pull request
May 9, 2026
Co-authored-by: factnn <1050552884@qq.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
smridhi06
pushed a commit
to smridhi06/FlagGems
that referenced
this pull request
May 10, 2026
Co-authored-by: factnn <1050552884@qq.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
smridhi06
pushed a commit
to smridhi06/FlagGems
that referenced
this pull request
May 13, 2026
Co-authored-by: factnn <1050552884@qq.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
smridhi06
pushed a commit
to smridhi06/FlagGems
that referenced
this pull request
May 15, 2026
Co-authored-by: factnn <1050552884@qq.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
tengqm
pushed a commit
that referenced
this pull request
May 17, 2026
Co-authored-by: factnn <1050552884@qq.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
PR Category
Operator
Type of Change
New Feature
Description
Add
rsuboperator implementation with Triton kernel.pointwise_dynamicIssue
N/A
Progress
Performance
torch.bfloat16
torch.float16
torch.float32
Overall: median speedup = 1.001x, mean speedup = 0.996x (45 data points)
Generated by auto_gen tool with Claude Code