[KernelGen][Nvidia] Add dsplit operator with view implementation - #5426
Open
ShawnsYing wants to merge 1 commit into
Open
[KernelGen][Nvidia] Add dsplit operator with view implementation#5426ShawnsYing wants to merge 1 commit into
ShawnsYing wants to merge 1 commit into
Conversation
ShawnsYing
requested review from
0x45f,
103yiran,
Caeruleann,
bin913,
douxetpur,
hellojack163,
huangyiqun,
tengqm and
w1120029931-bit
as code owners
August 12, 2026 10:51
Caeruleann
reviewed
Aug 15, 2026
| "cumsum_out", | ||
| "deg2rad", | ||
| "deg2rad_", | ||
| "dsplit", |
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def dsplit(input: torch.Tensor, indices_or_sections: Union[int, List[int]]): |
Collaborator
There was a problem hiding this comment.
So, it's not a triton operator?
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
This PR adds the
dsplitoperator with view implementation that performs zero-copy depth-wise splitting along dimension 2.The implementation delegates to existing
torch.splitandtorch.tensor_splitfunctions following the established pattern for view operators.Operators registered in
conf/operators.yaml:dsplit(marks:dsplit)Testing
Tested on H20 GPU:
.intoverload) and index arrays (.arrayoverload)Performance
Benchmark completed successfully on H20 GPU in 13.97s.
View operators achieve zero-copy semantics by sharing storage with the original tensor.
Multi-backend Testing
Files changed
src/flag_gems/ops/dsplit.py: Implementationsrc/flag_gems/ops/__init__.py: Import registrationsrc/flag_gems/__init__.py: ATen dispatch registration fordsplit.intanddsplit.arrayconf/operators.yaml: Operator configurationtests/test_dsplit.py: Accuracy testsbenchmark/test_dsplit.py: Performance tests