Closed
[Bug-Report|缺陷反馈]: matmul fusion pass 平台判断读取 soc_info.arch_type 在真机 Ascend950 上获取不到导致融合门控失效 #8308
zhangquanxinAdd on 16 days agoClosed at 13 days ago
16 days ago Added label: bug-report
16 days ago Assign zhangquanxin as responsible person
13 days ago Close issue
13 days ago changed custom state from 进行中 to 已完成
13 days ago Added label: resolved
Describe the current behavior / 问题描述
matmul 域图融合 pass 的平台门控(IsNpuArch3510Series 及 flat_quant/rotate_quant infershape、anti_quant、batch_matmul_to_transpose_batch_matmul 等同类判断)通过 fe::PlatformInfo 的 soc_info.arch_type 字段判断当前 NPU arch。线上真机 Ascend950 环境的 ini 配置不包含 arch_type 字段,GetPlatformInfoWithOutSocVersion 返回的 arch_type 不可靠,导致 3510 系列平台被误判为不支持:
仓内注释亦佐证该字段真机不可靠(fused_mat_mul_fusion_pass.cpp: the Ascend950 ini has no arch_type at all, which blocked the real 950 device)。
Environment Information / 环境信息
Steps to reproduce the issue / 重现步骤
Describe the expected behavior / 预期结果
真机 Ascend950 应被正确识别为 DAV_3510 系列(兼容 DAV_9201/DAV_9202),融合 pass 与 infershape 平台门控正常生效。
Related log / screenshot / 日志 / 截图
问题代码(修复前):
platformInfo.soc_info.arch_type == static_cast<int32_t>(Ops::Base::DAV_3510) (matmul/common/op_graph/fusion_pass/matmul_fusion_utils_pass.cpp:126 及 4 处同类判断点)
真机上该字段拿不到,比较恒为 false。
Special notes for this issue/备注
修复方案:平台判断改用运行时 API aclplatformGetDeviceInfo(ACL_PLATFORM_NPU_ARCH, buf) 获取 NPU arch 字符串("3510"/"9201"/"9202"),经 std::atoi 转换后与 arch 常量比较,不再依赖 fe::PlatformInfo 的 arch_type 字段。配套 UT stub 桥接(tests/ut/acl_platform_stub.cpp)保持单测可 mock。修复 MR 见关联 PR。