Closed
[Documentation|文档反馈]: 补充ViewCopy接口inplaceFlag参数说明 #587
ren-botaoAdd on  11 days agoClosed at  11 days ago
ren-botaoCollaborators
11 days ago Create

Document Link(文档链接)

Issues Section(问题文档片段)

本次补充的内容如下:

  1. 功能说明:补充原地实现场景下,3参数原型会禁用aclnn算子缓存;使用4参数原型并将inplaceFlag设置为true,则不禁用aclnn算子缓存。
  2. 函数原型:新增4参数原型 const aclTensor *ViewCopy(const aclTensor *x, const aclTensor *y, aclOpExecutor *executor, bool inplaceFlag)。
  3. 参数说明:新增inplaceFlag参数说明。
  4. 约束说明:补充原地关系的判定条件(x、y均为连续tensor,均不是executor分配的workspace数据,即数据均来自aclnn接口传入的tensor,且x、y数据地址相等),以及inplaceFlag为false/true时对aclnn算子缓存的处理逻辑与原因。
  5. 调用示例:修正executor参数为uniqueExecutor.get(),并补充原地场景调用示例。
  6. 同步更新 docs/zh、docs/en 下的 aclSetAclOpExecutorRepeatable.md:补充通过inplaceFlag声明原地场景时,同址不再影响aclOpExecutor复用。

Existing Issues(存在的问题)

ops-math仓已合入ViewCopy的4参数重载(见 https://gitcode.com/cann/ops-math/pull/6164 ),但opbase仓的ViewCopy接口资料此前只描述3参数原型,缺少新增重载的签名、inplaceFlag参数语义、原地关系判定条件,以及该参数对aclnn算子缓存和aclOpExecutor复用的影响说明,调用方无法从资料中获知该参数的使用前提与行为。本次补充上述说明。

关联 PR:https://gitcode.com/cann/opbase/pull/1129

likedislike
Rren-botaoCollaborators
11 days ago Added label: documentation
CANN-robot
CANN-robotCollaborators
11 days ago Comments:

Notice

This issue can not be assigned to renbotao. Please try to assign to the repository members.

likedislike
ren-botaoCollaborators
11 days ago Comments:

/assign @ren-botao

likedislike
CANN-robotCANN-robotCollaborators
11 days ago Assign ren-botao as responsible person
CANN-robotCANN-robotCollaborators
11 days ago Close issue
CANN-robotCANN-robotCollaborators
11 days ago Added label: resolved
ren-botaoCollaborators
10 days ago Comments:
likedislike