Skip to content

[2026春季][T2-1-3]xuzheng567#496

Open
xuzheng567 wants to merge 1 commit into
InfiniTensor:mainfrom
xuzheng567:2026-spring-xuzheng567-T2-1-3
Open

[2026春季][T2-1-3]xuzheng567#496
xuzheng567 wants to merge 1 commit into
InfiniTensor:mainfrom
xuzheng567:2026-spring-xuzheng567-T2-1-3

Conversation

@xuzheng567

@xuzheng567 xuzheng567 commented Jul 12, 2026

Copy link
Copy Markdown

基本信息

赛题:T2-1-3(qwen3 MOE模块优化)

队名:你说得都

成员:xz

github:

https://github.com/xuzheng567/InfiniCore

https://github.com/xuzheng567/InfiniLM

开发说明

添加fused moe算子以及相应测试脚本,使用cutlass进行优化加速。参照项目已有算子对多个硬件平台进行了适配尝试。

在已有的qwen3模型模块中,使用新的fused moe算子,替换掉了原本需要和cpu进行交互的moe计算方式。原本还重写了topk router部分,但后来发现框架对这一部分进行了更新迭代,改用框架内的最新写法。替换之后模型中计算逻辑中无cpu-gpu交互,可使用框架内自带的cuda graph功能进一步提速。

结果

推理性能测试

使用框架已有的bench.py,在输入输出长度均为1024的情况下测试

更改前:

python examples/bench.py --device=nvidia --model=Qwen3-30B-A3B-Instruct-2507/ --batch-size 1 --input-len 1024 --output-len 1024 --enable-paged-attn --attn=flash-attn
Generation completed in 71862.08 ms
Batchsize=1  Per_Batch_Input_Len=1024  Per_Batch_New_Tokens=1024

Prefill TTFT: 22704.45 ms  Throughput: 45.1 tok/s

Decode  Avg ITL: 48.05 ms   Throughput: 20.81 tok/s

更改后:

可使用cuda graph

python examples/bench.py --device=nvidia --model=Qwen3-30B-A3B-Instruct-2507/ --batch-size 1 --input-len 1024 --output-len 1024 --enable-paged-attn --attn=flash-attn --enable-graph
Generation completed in 11150.65 ms
Batchsize=1  Per_Batch_Input_Len=1024  Per_Batch_New_Tokens=1024

Prefill TTFT: 107.94 ms  Throughput: 9486.74 tok/s

Decode  Avg ITL: 10.79 ms   Throughput: 92.64 tok/s

Prefill吞吐提升210倍,Decode吞吐提升4.45倍

多平台适配

参照框架内已有的跨平台算子的格式,将fused moe算子适配了复用cuda代码的硬件平台:

平台
ILUVATAR
QY
HYGON
ALI
METAX
MOORE

时间原因,大部分国产平台未来得及验证。

HONOR_CODE.md
REFERENCE.md

@xuzheng567 xuzheng567 requested a review from a team July 12, 2026 11:38
@xuzheng567 xuzheng567 changed the title [2026春季][T2-1-3]xz [2026春季][T2-1-3]xuzheng567 Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant