[KMCompiler] perf-opt grouped_topk for DeepSeek-v3.2 - #92
Draft
liuxiao0909c wants to merge 7 commits into
Draft
Conversation
liuxiao0909c
force-pushed
the
grouped_topk_tune
branch
2 times, most recently
from
August 12, 2026 08:23
5af0046 to
7b6beff
Compare
Authored-by: WangZhen <23097963+0x45f@users.noreply.github.com>
Authored-by: WangZhen <23097963+0x45f@users.noreply.github.com>
…ai/FlagGems#4857) Authored-by: zhzhcookie <zhengyang@baai.ac.cn>
Authored-by: zhzhcookie <zhengyang@baai.ac.cn>
1. port kernel "grouped_topk_fused_small_expert_count_kernel" from vLLM 2. replace benchmark test shapes with top-hit shapes from DeepSeek-v3.2 3. add correctness test for top-hit shapes from DeepSeek-v3.2 4. port torch implementation from vLLM as vllm-uninstalled fallback in correctness test 5. enable tests for the metax backend
- Implement grouped_topk for ASCEND backend based on common implementation, remove INT64 usage - Add torch reference implementation for benchmarking (mthreads, hygon, ascend) - Mitigate torch.topk non-stability in correctness tests
liuxiao0909c
force-pushed
the
grouped_topk_tune
branch
3 times, most recently
from
August 26, 2026 06:47
2d69da0 to
500b2f0
Compare
…rouped_topk on HYGON
liuxiao0909c
force-pushed
the
grouped_topk_tune
branch
from
August 26, 2026 06:58
500b2f0 to
ba902b8
Compare
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
also pick following PR in FlagGems for benchmark test:
Performance
common config from DeepSeek-v3.2:
device: NVIDIA H800
vLLM version: 0.23.0
flagtree version: 0.6.0
test command:
pytest benchmark/test_grouped_topk.py -s --mode=cudagraphspeedup vs C in vLLM (min: 1.012, max: 1.974, avg: 1.331):
device: MetaX C550
vLLM version: 0.21.0
vLLM-metax version: 0.21.0
flagtree version: 0.6.1a2+metax3.6
test command:
pytest benchmark/test_grouped_topk.py -s --mode=cudagraphspeedup vs C in vLLM-metax (min: 1.432, max: 5.077, avg: 2.059):
device: PPU-ZW810E
vLLM-version: 0.19.0+cu130
flagtree version: 0.6.1+ppu3.6
test command:
pytest benchmark/test_grouped_topk.py -s --mode=cudagraphspeedup vs C in vLLM (min: 1.842, max: 5.965, avg: 2.872):
device: MTT S5000
flagtree version: 0.6.0+mthreads.gitc64a4918
test command:
pytest benchmark/test_grouped_topk.py -s --mode=cudagraphspeedup vs torch (min: 2.320, max: 6.679, avg: 4.993):
device: bw1000
flagtree version: 0.6.1a1+hcu3.6
aiter version: 0.1.3+das.opt1.dtk2604.torch2100.2606172003.g0a655d
test command:
pytest benchmark/test_grouped_topk.py -s --mode=cudagraphspeedup vs C (min: 1.142, max: 7.166, avg: 5.069):
device: Ascend910_9382 (910c)
flagtree version: 0.6.0+ascend.gitca1dd135
test command:
pytest benchmark/test_grouped_topk.py -s(mode=cudagraph not supported)speedup vs torch (min: 0.506, max: 9.821, avg: 4.646):