[KMCompiler]Optimize index_copy and index_copy_ generic kernels - #5496
Open
Onisen7 wants to merge 6 commits into
Open
[KMCompiler]Optimize index_copy and index_copy_ generic kernels#5496Onisen7 wants to merge 6 commits into
Onisen7 wants to merge 6 commits into
Conversation
Remove debug flag from triton.jit decorator. Signed-off-by: Onisen7 <2084548879@qq.com>
Collaborator
|
/test | index_copy:H100 |
Contributor
❌ On-demand test failedOperator: The test failed to complete. Check the workflow run for details. |
Collaborator
|
/test index_copy:h20 |
Contributor
Test Environment
Test ResultAccuracy ResultSummary
Performance ResultSummary
Benchmark data
📎 Download the full log here |
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
Performance Optimization
Description
This PR optimizes
index_copyandindex_copy_across the generic path andthe Ascend backend.
For the generic implementation in
src/flag_gems/ops/index_copy_.py, this PR:every complete input shape.
For the Ascend backend, this PR adds an Ascend-specific implementation in:
src/flag_gems/runtime/backend/_ascend/ops/index_copy_.pysrc/flag_gems/runtime/backend/_ascend/ops/__init__.pyThe Ascend implementation:
inner_size <= 4;index_copyand in-placeindex_copy_.Issue
N/A
Progress
Testing
Functional test command:
Result:
24 passedon NVIDIA H20, Hygon, PPU, MetaX MC550, Iluvatar, andAscend 910B.
Ascend test environment:
Performance
Generic benchmark command:
unset TRITON_DEBUG python -m pytest -s benchmark/test_index_copy.pySpeedup = PyTorch latency / FlagGems latency.index_copybeforeindex_copyafterindex_copy_beforeindex_copy_afterAscend benchmark command:
The default benchmark ran in
kernelmode at thecomprehensivelevel.The generic implementation completed the functional test with
24 passed,but did not complete the default Ascend benchmark. The new Ascend-specific
implementation completed all 48 benchmark rows: 2 APIs, 3 dtypes, and 8 input
configurations.
float16meanfloat32meanbfloat16meanindex_copyindex_copy_The Ascend values are arithmetic means of the configured benchmark rows.
Performance varies by input shape, so the reported means do not imply that
every individual configuration is faster than the native implementation. Full
per-shape benchmark logs are available if additional review is needed.