Skip to content

feat(vpto): support FP8 local contiguous memory lowering - #1116

Merged
Zhendong404 merged 1 commit into
hw-native-sys:mainfrom
KurrinQu:qkl/vpto-fp8-local-contiguous-memory
Aug 4, 2026
Merged

feat(vpto): support FP8 local contiguous memory lowering#1116
Zhendong404 merged 1 commit into
hw-native-sys:mainfrom
KurrinQu:qkl/vpto-fp8-local-contiguous-memory

Conversation

@KurrinQu

@KurrinQu KurrinQu commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator
  • Support lowering f8E4M3FN and f8E5M2 scalar/vector types to native HiVM LLVM FP8 types.
  • Convert the element-type properties carried by llvm.alloca and llvm.getelementptr.

@KurrinQu
KurrinQu force-pushed the qkl/vpto-fp8-local-contiguous-memory branch from cfc4c63 to 3cf067a Compare August 4, 2026 03:11
@mouliangyu

Copy link
Copy Markdown
Collaborator

Review note (non-blocking for the intended local-memory path):

I validated the LLVM IR produced by this PR for FP8 alloca / GEP / load / store, with FP8 values produced by pto.convert, using CANN 9.0.0 Bisheng:

bisheng --target=hiipu64-hisilicon-cce \
  -march=dav-c310-vec \
  --cce-aicore-arch=dav-c310-vec \
  --cce-aicore-only -O2 -c -x ir <input.ll> -o <output.o>

That path compiles successfully.

One boundary should probably be made explicit: directly constructed FP8 constants such as

arith.constant dense<0.0> : vector<4xf8E5M2>

should be treated as unsupported, rather than lowered through the generic typed-carrier pattern. The generic pattern converts the result type while retaining the original typed value attribute. Attempts to lower the constant through an integer-vector bitcast can produce LLVM IR accepted by llvm-as, but CANN 9.0.0 Bisheng crashes in ConstantFoldCastInstruction (including zero constants).

I suggest adding an early diagnostic/verifier rejection plus a negative test for direct FP8 constants. This does not affect the supported pto.convert -> FP8 local memory path covered by this PR.

@KurrinQu
KurrinQu force-pushed the qkl/vpto-fp8-local-contiguous-memory branch from 3cf067a to 0e9f0ab Compare August 4, 2026 07:33

@mouliangyu mouliangyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KurrinQu
KurrinQu force-pushed the qkl/vpto-fp8-local-contiguous-memory branch from 0e9f0ab to 7bd22de Compare August 4, 2026 11:28
@KurrinQu
KurrinQu force-pushed the qkl/vpto-fp8-local-contiguous-memory branch from 7bd22de to 47af597 Compare August 4, 2026 11:54
@Zhendong404
Zhendong404 merged commit 1309ee9 into hw-native-sys:main Aug 4, 2026
22 of 25 checks passed
@reedhecre

Copy link
Copy Markdown

A3 板测失败

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

失败用例

  • comm_p2p_binding_variants (run, exit=1)
  • comm_p2p (run, exit=1)

@reedhecre

Copy link
Copy Markdown

A3 板测失败详情:PR #1116

comm_p2p_binding_variants

stage=run info=exit=1

[ERROR] aclrtSynchronizeStream(stream) failed: 507035 (/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260804_072612_merged_pr1116/npu_validation/CommSync/comm_p2p_binding_variants/main.cpp:122)
[ERROR] RecentErrMsg: EZ9999: Inner Error!
EZ9999[PID: 2940000] 2026-08-04-08:15:17.529.796 (EZ9999):  The error from device(chipId:0, dieId:1), serial number is 2596, there is an exception of aivec error, core id is 19, error code = 0x10, dump info: pc start: 0x124200000000, current: 0x124200000164, vec error info: 0x4000000b7, mte error info: 0x7503000008, ifu error info: 0x212c0d6200800, ccu error info: 0x40e028000000004f, 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:(0x10, 0, 0) errorStr: Illegal instruction, which is usually caused by unaligned UUB addresses. fixp_error0 info: 0x3000008, fixp_error1 info: 0x75, fsmId:1, tslot:6, 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=1, stream_id=46, report_stream_id=46, task_id=0, flip_num=0, fault kernel_name=comm_p2p_binding_variants_kernel, fault kernel info ext=comm_p2p_binding_variants_kernel, program id=0, hash=3889294368825709812.[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-04 08:15:19] ERROR: testcase failed (exit 1): comm_p2p_binding_variants
comm_p2p

stage=run info=exit=1

[ERROR] aclrtSynchronizeStream(stream) failed: 507035 (/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260804_072612_merged_pr1116/npu_validation/CommSync/comm_p2p/main.cpp:122)
[ERROR] RecentErrMsg: EZ9999: Inner Error!
EZ9999[PID: 2952523] 2026-08-04-08:15:36.825.096 (EZ9999):  The error from device(chipId:0, dieId:1), serial number is 2597, there is an exception of aivec error, core id is 24, error code = 0x10, dump info: pc start: 0x124200000000, current: 0x124200000168, vec error info: 0x4000000b7, mte error info: 0x7503000008, ifu error info: 0x212c0d6200800, ccu error info: 0x40e028000000004f, 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:(0x10, 0, 0) errorStr: Illegal instruction, which is usually caused by unaligned UUB addresses. fixp_error0 info: 0x3000008, fixp_error1 info: 0x75, fsmId:0, tslot:6, 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=1, stream_id=46, report_stream_id=46, task_id=0, flip_num=0, fault kernel_name=comm_p2p_kernel, fault kernel info ext=comm_p2p_kernel, program id=0, hash=15664819858989799263.[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-04 08:15:38] ERROR: testcase failed (exit 1): comm_p2p

@reedhecre

Copy link
Copy Markdown

A5 板测成功

  • 触发方式:merged
  • 源码提交:1309ee9ffca5
  • 结果汇总:OK 21 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260805_043507_merged_pr1116.log
  • 结果 TSV:/root/ptoas-board-monitor-a5/logs/20260805_043507_merged_pr1116.tsv

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.

4 participants