Open
[Bug-Report|缺陷反馈]: CANN 9.2.1 上编译 ops-transformer 的 megamoe 算子失败(gm_to_l1_trait 定义不一致) #7220
XIAOJIFANAdd on 1 day ago
周云飞
1 day ago Comments:
1 day ago Comments:
问题说明
从报错和您提供的定义看,这是头文件接口不匹配:gm_to_l1_trait{true} 需要可接收该值的成员,而空结构体无法这样初始化,因此触发 excess elements in struct initializer。MegaMoE 的 MX GEMM 实现确实引用了 blaze 的 tile_trait.h;但 CANN 9.2.1 中各份定义及实际包含顺序尚未独立验证。
处理建议
可行方向是让 blaze 与工具链使用配套的 trait 定义及实现。若需兼容旧接口,应先确认预分配语义,不能仅删除 {true} 或替换单个头文件来消除报错;还需验证 arch35 编译及相关数据搬运行为。
请补充实际编译的 ops-transformer 提交号,以便确定对应代码与 CANN 9.2.1 的兼容范围。


Describe the current behavior / 问题描述 (Mandatory / 必填)
在 CANN 9.2.1 上编译 ops-transformer 的 MegaMoE 算子(
mc2/mega_moe,arch35/A5)时,blaze 头要求gm_to_l1_trait带pre_allocation成员,但工具链asc/include里该类型仍是空结构体,编译直接失败。MegaMoE 的 arch35 kernel 走 blaze MX GEMM:
而
tile_trait.h:43按新语义初始化:struct CopyGM2L1TraitPreAllocation { using TraitType = asc::te::gm_to_l1_trait; static constexpr const TraitType value = asc::te::gm_to_l1_trait{true}; };CANN 9.2.1 里有三份不同步的
copy_trait.h:gm_to_l1_traitaarch64-linux/asc/include/.../copy_trait.hstruct gm_to_l1_trait {};(旧,优先被搜到)opp/.../ops_transformer/.../copy_trait.hbool pre_allocation(新)opp/.../ops_nn/.../copy_trait.h#380/!590引入该用法后,blaze 头需要新定义,而 9.2.1 工具链的asc/include仍是旧副本。Environment Information / 环境信息 (Mandatory / 必填)
/usr/local/Ascend/cann-9.2.1)Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
git clone https://gitcode.com/cann/ops-transformer.git cd ops-transformer source /usr/local/Ascend/cann-9.2.1/set_env.sh bash build.sh --pkg --soc=ascend950 --ops=mega_moe -j16Describe the expected behavior / 预期结果 (Mandatory / 必填)
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
参见上一节。
Special notes for this issue/备注 (Optional / 选填)