Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
新支持功能 新增支持batch一致性,当用户将确定性等级设置为 3 时,MhcPre 开启 Batch 一致性模式: torch_npu 接口:调用:torch_npu.npu.set_deterministic_level(3) aclnnMhcPre 和 aclnnMhcPreV2 共用同一套 tiling 逻辑,因此两套接口都支持该能力。
解决的问题 MhcPre 原有 tiling 会根据输入 shape 在 SPLIT_M_K、SPLIT_ND 和 SPLIT_BS 之间选择。 开启 deterministic_level=3 后,算子固定使用 SPLIT_BS,使 Batch 方向采用稳定的计算和累加顺序,从而满足 Batch 一致性场景的要求。 相关tiling代码修改在PR:https://gitcode.com/cann/ops-transformer/pull/9243/diffs
/assign @hyhhh14
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
新支持功能
新增支持batch一致性,当用户将确定性等级设置为 3 时,MhcPre 开启 Batch 一致性模式:
torch_npu 接口:调用:torch_npu.npu.set_deterministic_level(3)
aclnnMhcPre 和 aclnnMhcPreV2 共用同一套 tiling 逻辑,因此两套接口都支持该能力。
解决的问题

MhcPre 原有 tiling 会根据输入 shape 在 SPLIT_M_K、SPLIT_ND 和 SPLIT_BS 之间选择。
开启 deterministic_level=3 后,算子固定使用 SPLIT_BS,使 Batch 方向采用稳定的计算和累加顺序,从而满足 Batch 一致性场景的要求。
相关tiling代码修改在PR:https://gitcode.com/cann/ops-transformer/pull/9243/diffs
Benefit / Necessity (价值/作用)
Design(设计方案)