已开启
【UBSE】支持查询产品类型 #1455
【UBSE】支持查询产品类型 #1455
已开启
fangyuhao创建于 8 天前
fangyuhao
8 天前

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

参考:openEuler社区《生成式AI工具使用与开源贡献政策》

PR功能描述 / 为什么需要这个合入**:

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

likedislike
合并受阻
Ffangyuhao
8 天前 创建了 pull request,commit e28aaf61
openeuler-ci-botopeneuler-ci-bot成员
8 天前 将hlinbo,shw030915,Gao_Victor,qmyyxtl,caowaterman设为审查人
atomgit-bot
atomgit-bot
8 天前 评论:

变更摘要

该 PR 主要支持在 NPU 设备列表中查询并返回产品类型。服务端在查询/分配设备的响应消息头中新增 1 字节的 product_type 字段:QueryDeviceExecute 通过 ResourceCollection::GetInstance().GetProductType 获取产品类型并传入响应封装流程,PackDevListQueryDeviceRespPack 增加 productType 参数并负责写入该字段,GetProductType 由私有方法调整为公有方法;C 与 Python SDK 侧同步在设备列表结构体中新增 product_type 字段并在解包时读取。

主要改动

  • 服务端查询与打包产品类型: QueryDeviceExecute 调用 ResourceCollection::GetInstance().GetProductType(productType) 获取产品类型;QueryDeviceRespPackPackDevList 增加 uint8_t productType 参数,由 PackDevList 通过 UbsePackUint8 写入响应消息;ubse_npu_resource_collection.h 中将 GetProductType 从私有方法移到公有区域。
  • 扩展响应消息头: HEAD_SIZE6 * sizeof(uint8_t) 调整为 sizeof(uint8_t) + 6 * sizeof(uint8_t),即响应消息头新增 1 字节的 product_type 字段;PackAllocResp 调用 PackDevList(devList, 0, packUtil),分配响应中该字段填 0。
  • C SDK 结构体与解包逻辑: ubs_engine_npu.h 中设备列表结构体新增 uint8_t product_type 字段(注释标明 0=SERVER、1=POD_16_1825、2=POD_32_1825);libubse_npu_helper.cppInnerUbDevListUnpack 在解包时先读取 deviceList.product_type,失败则返回 UBS_ERR_BUFFER_TOO_SMALL
  • Python SDK 模型同步: ubs_engine_model_npu.pyUbsUbDevicesListT_fields_ 新增 ("product_type", ctypes.c_uint8),与 C 侧结构体保持一致。
likedislike
atomgit-bot
atomgit-bot
8 天前 评论:

代码审查

✅ 未发现问题

likedislike
openeuler-ci-botopeneuler-ci-bot成员
8 天前 添加了label:sig/sig-UB-ServiceCore
此处折叠了82条消息 查看更多
openeuler-ci-botopeneuler-ci-bot成员
2 天前 删除了label:ci_processing
openeuler-ci-bot
openeuler-ci-bot成员
2 天前 评论:
Check Name Build Result 详情 Build Details
check_sca WARNING • SCA检查发现未确认的开源组件问题,请查看报告: https://www.openlibing.com/apps/personalScandTaskInfor/person/59ab1081-2a30-49ab-ab34-998f8d92fbce?projectId=300024&codeHostingPlatformFlag=gitcode #6974
check_code SUCCESS
check_package_license WARNING • 仓库copyright检查未通过: 缺少项目级Copyright声明文件
x86_64 check_build SUCCESS #6964
aarch64 check_build SUCCESS #6972
pre-commit check_build SUCCESS #6312
DT check_build SUCCESS #6262
check_issue_associate check_build SUCCESS #9772
likedislike
openeuler-ci-botopeneuler-ci-bot成员
2 天前 添加了label:ci_successful
openeuler-ci-bot
openeuler-ci-bot成员
2 天前 评论:
likedislike
Zzhangkun
1 天前 解决了最后一个问题