Skip to content

fix(vpto): add SIMT fastmath control - #1138

Merged
Zhendong404 merged 1 commit into
hw-native-sys:mainfrom
Zhendong404:codex/issue-1117
Aug 12, 2026
Merged

fix(vpto): add SIMT fastmath control#1138
Zhendong404 merged 1 commit into
hw-native-sys:mainfrom
Zhendong404:codex/issue-1117

Conversation

@Zhendong404

Copy link
Copy Markdown
Collaborator

Summary

  • Add --simt-fastmath, disabled by default.
  • Pass --cce-simt-fpmath-combine=false to Bisheng by default and enable it only when explicitly requested.
  • Add CLI regression coverage for the new option.

Validation

  • PTOAS compiler shared library builds successfully.
  • ptoas --simt-fastmath --help and ptoas --simt-fastmath=false --help succeed.
  • The issue-1117 mul/add repro emits different objects for default and --simt-fastmath modes.
  • Default LLVM IR remains separate fmul and fadd operations.

Scope

This PR addresses the implicit SIMT mulf + addf contraction described in issue #1117. The scalar high-precision fdiv question remains open: CANN 9.0.0 exposes high-precision division only through vector bisheng::cce::simd::hp::vdiv / PTO Div754-style helpers; the candidate scalar LLVM intrinsics are not selectable on the current A5 Bisheng target.

Refs #1117

@Zhendong404
Zhendong404 merged commit 53da58f into hw-native-sys:main Aug 12, 2026
12 of 13 checks passed
@reedhecre

Copy link
Copy Markdown

A5 板测失败

  • 触发方式:merged
  • 源码提交:53da58f4b57b
  • 结果汇总:OK 20 / FAIL 1 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260812_110505_merged_pr1138.log
  • 结果 TSV:/root/ptoas-board-monitor-a5/logs/20260812_110505_merged_pr1138.tsv
  • 失败阶段:board-validation-qwen / exit=1

失败用例

  • rope_kv_cache (run, exit=2)

@reedhecre

Copy link
Copy Markdown

A3 板测失败

  • 触发方式:merged
  • 源码提交:53da58f4b57b
  • 结果汇总:OK 218 / FAIL 2 / SKIP 3
  • 日志:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260811_200435_merged_pr1138.log
  • 结果 TSV:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260811_200435_merged_pr1138.tsv
  • 失败阶段:board-validation / exit=1

失败用例

  • ci (run, exit=2)
  • gather_legacy (run, exit=1)

@reedhecre

Copy link
Copy Markdown

A3 板测失败详情:PR #1138

ci

stage=run info=exit=2

[ERROR] Mismatch: golden_v1.bin vs v1.bin, max diff=2.0 at idx=0 (golden=1, out=-1, dtype=int32)
[ERROR] compare failed
[2026-08-11 20:29:48] ERROR: testcase failed (exit 2): ci
gather_legacy

stage=run info=exit=1

[ERROR] aclrtSynchronizeStream(stream) failed: 507035 (/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260811_200435_merged_pr1138/npu_validation/Gather/gather_legacy/main.cpp:114)
[ERROR] RecentErrMsg: EZ9999: Inner Error!
EZ9999[PID: 4069118] 2026-08-11-20:33:45.020.644 (EZ9999):  The error from device(chipId:2, dieId:1), serial number is 252, there is an exception of aivec error, core id is 47, error code = 0x4000000000000000, dump info: pc start: 0x124a00000000, current: 0x124a00000094, vec error info: 0xf01d, mte error info: 0x350300402d, ifu error info: 0x212d052480440, ccu error info: 0x3800059, cube error info: 0, biu error info: 0, aic error mask: 0x6500020bd00028c, para base: 0x12c100000000.[FUNC:PrintCoreInfo][FILE:device_error_core_proc.cc][LINE:645]
        TraceBack (most recent call last):
       The extend info: errcode:(0x4000000000000000, 0, 0) errorStr: VEC instruction error: the ub address out of bounds. fixp_error0 info: 0x300402d, fixp_error1 info: 0x35, fsmId:1, tslot:0, thread:0, ctxid:0, blk:0, sublk:0, subErrType:4.[FUNC:PrintCoreInfo][FILE:device_error_core_proc.cc][LINE:658]
       Kernel task happen error, retCode=0x31, [vector core exception].[FUNC:PreCheckTaskErr][FILE:davinci_kernel_task.cc][LINE:1729]
       AIV Kernel happen error, retCode=0x31.[FUNC:GetError][FILE:stream.cc][LINE:1475]
       [AIC_INFO] after execute:args print end[FUNC:GetError][FILE:stream.cc][LINE:1475]
       [DFX_INFO]Aicore kernel execute failed, device_id=5, stream_id=46, report_stream_id=46, task_id=0, flip_num=0, fault kernel_name=vec_add_scalar_kernel_2d, fault kernel info ext=vec_add_scalar_kernel_2d, program id=0, hash=13985294925899954301.[FUNC:GetError][FILE:stream.cc][LINE:1475]
       rtStreamSynchronize execution failed, reason=vector core exception[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:65]
       synchronize stream failed, runtime result = 507035[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:148]
[2026-08-11 20:33:47] ERROR: testcase failed (exit 1): gather_legacy

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.

2 participants