Closed
GMM arch35 kernel 清理残留 TPipe 依赖及未使用定义 #4386
yangyang016Add on Aug 18Closed at 13 days ago
Aug 18 Assign cc-z as responsible person
Aug 18 Assign kknan as responsible person, remove original responsible person: cc-z
kknan
Sep 1 Comments:
Sep 1 Comments:
GMM算子a8w4场景Tpipe消减已合入,剩余场景开发和验证中。
设计场景较多,开发和验证工作量较大


游震
Sep 16 Comments:
Sep 16 Comments:
已合入部分场景,占比约40%


周云飞
19 days ago Comments:
19 days ago Comments:
目前是部分场景已合入,尚未完成全部清理:此前反馈 a8w4 场景的 TPipe 消减已合入,最近评论给出的整体进度约为 40%,其余场景仍在开发和验证中。
清理方向可以区分两类:
- 对确认未使用的形参和
using声明,可删除并同步调整声明、定义及调用点,减少冗余接口。 - 对仍参与资源分配或初始化的
TPipe,不宜直接统一替换为GetTPipePtr();需确认获取的是预期实例,并保持Reset()、MatmulInit()、预处理初始化及同步资源生命周期不变。
这属于接口与依赖简化,不能仅凭残留 TPipe 判断存在功能缺陷。剩余清理仍需以 arch35 编译及相关 GMM ST/UT 验证结果为依据。


13 days ago Close issue
13 days ago changed custom state from 进行中 to 已完成
13 days ago Added label: resolved
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
在
gmm/*/op_kernel/arch35生产 kernel 范围内扫描了 78 个.h/.hpp/.cpp/.cc/.cxx/.asc文件,发现 20 个文件仍包含TPipe。其中 7 处属于明确未使用的定义:
gmm/grouped_matmul/op_kernel/arch35/quant_adaptive_sliding_window_templates/gqmm_cgmct_mx_kernel.h:34:形参AscendC::TPipe *que未引用。gmm/grouped_matmul/op_kernel/arch35/quant_adaptive_sliding_window_templates/gqmm_cgmct_pertile_kernel.h:34:形参AscendC::TPipe *que未引用。gmm/grouped_matmul/op_kernel/arch35/quant_adaptive_sliding_window_templates/gqmm_tensor_api_mx_kernel.h:33:que仅通过(void)que消警。gmm/grouped_matmul/op_kernel/arch35/weight_quant_basic_block/weight_quant_vec_compute.h:251:Init的tPipe形参未使用,函数内部实际通过GetTPipePtr()分配 EventID。gmm/grouped_matmul_finalize_routing/op_kernel/arch35/weight_quant_basic_block/gmm_fr_weight_quant_vcv_basic_block.h:33:using AscendC::TPipe未使用。gmm/grouped_matmul_swiglu_quant_v2/op_kernel/arch35/grouped_matmul_swiglu_quant_v2_mxfp4_weight_nz.h:40:tpipe仅通过(void)tpipe消警。gmm/grouped_matmul_swiglu_quant_v2/op_kernel/arch35/weight_quant_basic_block/gmmsq_weight_quant_vcv_basic_block.h:30:using AscendC::TPipe未使用。另外 13 个文件中的
TPipe当前仍有实际传递或调用,包括 int4/s8s4 预处理、quant adaptive sliding window、weight quant basic block/controller,以及 swiglu per-token quant 等路径,需要进一步确认是否可改为内部获取或无显式TPipe的接口。Benefit / Necessity (价值/作用)
清理 arch35 kernel 中无效的
TPipe参数和 using 声明,避免通过(void)掩盖冗余接口;同时收敛剩余显式TPipe依赖,降低调用链耦合和维护成本,并减少未使用定义相关的告警风险。Design(设计方案)
TPipe的文件逐一确认生命周期和接口约束;可使用GetTPipePtr()或无需显式 pipe 的接口时,移除参数透传。Reset()、MatmulInit()和预处理初始化行为,避免改变同步与资源生命周期。