Merged
[feat]: 支持device传输异常上报 #681
lining23666Add on Jun 26
[feat]: 支持device传输异常上报 #681
Merged
Merged fromlining23666/hixltmp_0422intocann/hixlmaster
Pull Request has been successfully merged by CANN-robot.
(Thank you for lining23666's contribution.)Jun 26 Created pull request, commit a95d5182
Jun 26 Added label: cann-cla/yes
CANN-robot
Jun 26 Comments:
Jun 26 Comments:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/hixl | ✅ zhujingjing, youyx, zhaozhihui (3/2) | ✅ zhujingjing (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
lining23666, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Jun 26 Pre merge succeeded (commit_id: 2ac0442d2b95da6a298f8f07ed69bbc6a1ef524f)
Jun 26 Force-pushed 1 commits:a6c175a2-[feat]: add HixlSyncTransferCtx device kernel for exception reporting
Jun 26 Force-pushed 1 commits:a6c175a2-[feat]: add HixlSyncTransferCtx device kernel for exception reporting
289 messages are collapsed here。 See more
youxiao
Jul 29 Comments:
Jul 29 Comments:
/lgtm


Jul 29 Added label: lgtm
zhujingjing
Jul 29 Comments:
Jul 29 Comments:
/approve


Jul 29 Added label: approved
Jul 29 Merged pull request
提交 PR 前,请先阅读 HIXL贡献指南 ,查看 PR 提交方式并遵守相关提交规范。
类型标签
描述
当前 HIXL CS 路径(TransferPool + HixlCSClient)在传输过程中若 Device 侧 Hcomm 通信线程发生底层传输异常(如 RDMA 重传超次、网卡故障、链路闪断等),AICPU Kernel 无法正常完成,用户侧无法及时感知异常:
complete_flag永远不会被置位,用户侧只能等待超时。本 PR 在 Device 侧建立一条从 Hcomm 到 TSFW 的异常上报通路。Device 侧捕获 Hcomm 传输异常后,通知 TSFW 终止 notify wait,使同步和异步场景均能在异常时立即返回,无需等待超时。同时,
HixlBatchTransfer失败时自动写 err_flag,Host 侧可通过读取 err_flag 感知传输失败。主要改动
1. TaskExceptionHandler 单例(
src/ops/hixl_kernel/task_exception_handler.h/.cc,新增)封装 Hcomm 异常回调注册/注销和 TSFW 通知逻辑:
EnableExceptionCallback():调用HcommRegisterExceptionCallback注册回调,内部atomic<bool>CAS 保证只注册一次DisableExceptionCallback():调用HcommUnregisterExceptionCallback按函数指针注销HixlTaskExceptionCallback:查映射表 → 写 err_flag → 通过halEschedSubmitEvent通知 TSFWts_aicpu_msg_info_t(david 形态)构造 TSFW 消息,错误码统一上报TS_ERROR_HCCL_OTHER_ERROR2. TransferContextManager 扩展(
src/ops/hixl_kernel/transfer_context_manager.h/.cc)TransferContext新增notify_id/err_flag_dev_va字段和WriteErrorFlag()方法(固定写 1)Add时自动调用TaskExceptionHandler::EnableExceptionCallback()(锁外调用,避免死锁)Delete后映射表为空时调用TaskExceptionHandler::DisableExceptionCallback()(锁外调用)3. HixlBatchTransfer 失败写 err_flag(
src/ops/hixl_kernel/hixl_batch_transfer.cc)传输失败时通过
HIXL_DISMISSABLE_GUARD自动写 err_flag,成功时 dismiss4. Hcomm 异常接口适配(
src/hixl/proxy/)hcomm/hcomm_exception_notify.h:Hcomm 异常信息结构体定义(HcommExceptionInfo、ExceptionCallback等)hcomm_proxy.h/.cc:新增RegisterExceptionCallback/UnregisterExceptionCallback代理方法5. extern 头文件(
src/ops/hixl_kernel/extern_include/tsch/,新增)aicpu_msg.h:TS AICPU 消息结构体(ts_aicpu_msg_info_t、ts_aicpu_record_msg_t等)task_scheduler_error.h:TS 错误码定义(TS_ERROR_HCCL_OTHER_ERROR等)6. 测试(
tests/)tests/depends/aicpu/:打桩aicpuGetContexthccl_stub:打桩HcommRegisterExceptionCallback/HcommUnregisterExceptionCallbackWriteErrorFlag、TaskExceptionHandler、HixlBatchTransfer失败写 err_flag、异常回调(含 STARS 异常类型、TSFW 通知成功/失败)测试项
HcommExceptionInfoToStringSTARS 分支测试结果
bash tests/run_test.sh -t cpp -s hixl:747 tests PASSEDbash build.sh:Build success(device kernel 编译通过)同步
异步
Checklist
其它
本 PR 仅实现 Device 侧(Part 2),Host 侧 err_flag 资源管理、
HixlSyncTransferContextKernel 下发、CheckStatusDevice扩展等待后续 PR 实现。