| Files | Last commit | Last update |
|---|---|---|
perf(machine): Optimize stitch code Co-authored-by: gaoxingwang<camuel.gao@huawei.com> # message auto-generated for no-merge-commit merge: !5531 merge perf/stitch-attr-optimize into master perf(machine): Optimize stitch code Created-by: gaoxingwang Commit-by: gaoxingwang Merged-by: cann-robot Description: # PR 5531 优化点 > perf(machine): Optimize stitch attr access with cachedAttrBase and if constexpr ## 优化点清单 | # | 优化点 | 改动文件 | 改前 | 改后 | 优化类型 | |---|--------|---------|------|------|---------| | 1 | 属性基址缓存 | dev_callop_attribute.h | 每次调用 3 次 GetOperationAttr 查表获取 offset/rawShape/validShape 指针 | cachedAttrBase 懒加载 1 次 GetSymoffset,后续指针偏移直接算 | 热路径查表消除 | | 2 | 结构体字段瘦身 | dev_encode_operation.h | shapeAttrIdx + wrapTaskHubOpIdx 两个字段 | 删除 shapeAttrIdx(改为 offsetAttrIdx+dim 按需算),wrapTaskHubOpIdx → stitchOpIdx(encode 期预赋值) | 结构体缩小 + runtime 查表消除 | | 3 | offsetAttrIdx 预累加 | dev_encode.cpp | runtime 每次查 opAttrOffsetList_ 获取 opAttrBase | encode 期 offsetAttrIdx += opAttrBase,runtime 直接读 | 以存代算 | | 4 | stitchOpIdx 预赋值 | dev_encode.cpp | runtime if (wrapTaskHubOpIdx != INVALID) 判断 + 赋值 | encode 期 stitchOpIdx = (hub存在) ? hubIdx : operationIdx | 以存代算 + 分支消除 | | 5 | 构造函数参数减少 | dev_encode.cpp | emplace_back(opIdx, coaIndex, coaIndex+dimSize, ...) 传 3 个 index | emplace_back(opIdx, coaIndex, ...) 传 2 个,shape 索引按需算 | 调用开销减少 | | 6 | skipExpression 模板消除 | dev_callop_attribute.h | template <bool skipExpression> 循环内 3×dim 次 if (skipExpression) 运行时分支 | 去掉模板参数和运行时分支 | 编译期分支消除 | | 7 | 循环合并 | dev_callop_attribute.h | CheckOffsetAndValidShapeInRawShape 两个独立 for 循环 | 合并为一个循环 | 循环开销减半 | | 8 | IsCellMatchDescFillReady 删除 | dev_callop_attribute.h | runtime 每次遍历所有维度检查 cellShape/stride > 0 | 删除函数,host encode 期保证 desc 已填充 | device 侧检查消除 | | 9 | Dump 隔离 | device_slot_context.cpp / device_stitch_context.cpp / dump_device_topo.cpp | DumpProducerCellAccess/DumpConsumerCellAccess 裸调用 | DEV_IF_NONDEVICE 包裹,device 编译期排除 | device 侧零开销 | | 10 | unlikely 标注 | dev_callop_attribute.h | if (clamped) 无分支预测提示 | if (unlikely(clamped)) | 分支预测优化 | | 11 | CellMatchProcessByDim 局部变量 | dev_encode_function_stitch.h | switch (cellMatchTableDesc.cellShape.dimSize) 每次读结构体字段 | switch (dims) 用局部变量 | 循环不变量外提 | | 12 | CellMatchHandle dims 外提 | dev_encode_function_stitch.h | 循环内 cellMatchTableDesc.GetDimensionSize() 重复调用 | 提到循环外存 dims | 循环不变量外提 | | 13 | Process 签名加 desc | dev_encode_function_stitch.h | 每个 Handler 内部重复读 cellMatchTableDesc | 通过参数传入 const DevCellMatchTableDesc& desc | 参数传递优化 | | 14 | runtime wrapTaskHubOpIdx 查表消除 | device_stitch_context.cpp | runtime if (consumer.wrapTaskHubOpIdx != INVALID) 判断 + 赋值 consumerOpIdx | 直接用 consumer.stitchOpIdx | runtime 分支消除 | | 15 | GetTensorOffsetAndValidShape 调用优化 | device_stitch_context.cpp | 传 operationIndex + offsetAttrIdx,函数内部查 GetOperationAttr | 传 offsetAttrIdx + cachedAttrBase,函数内部用缓存指针 | 热路径查表消除 | See merge request: cann/pypto!5531 | 3 months ago | |
test(machine): Supplement machine UT test cases. Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !4935 merge machine_ut into master test(machine): Supplement machine UT test cases. Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: PR 应该避免没有描述信息,描述信息的最重要的作用是描述修改意图,应该清晰明了。例如:标题中包含了 fix 标签,如果没有描述信息,就需要Review人员猜测PR具体修复了哪些内容,或者怀疑修改的必要性。如果PR和特定的Issue相关,可以单独包含一行 Related Issue: 放到描述信息最后。 下面是一个典型的PR描述信息: The origin issue template brings too many noise, it's not suitable for git message. eg: comments are not removed, labels are redundant as the PR tile already contains the tag. The guide gives a clear suggestion on how to write the PR body. Related Issue: #1234,#5678 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!4935 | 4 months ago | |
test(machine): Supplement machine UT test cases_8. Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !5271 merge ut_9 into master test(machine): Supplement machine UT test cases_8. Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: machine ut 补充 See merge request: cann/pypto!5271 | 3 months ago | |
fix(machine): Add aicore-resolve macro Co-authored-by: huanglu<huanglu22@hisilicon.com> # message auto-generated for no-merge-commit merge: !5549 merge master into master fix(machine): Add aicore-resolve macro Created-by: lululu40888 Commit-by: huanglu Merged-by: cann-robot Description: fix(machine): Add aicore-resolve macro See merge request: cann/pypto!5549 | 3 months ago | |
perf(machine): split LOCAL_READY_MATRIX slab type and trim aicpu-resolve stitch pool budget Co-authored-by: huanglu<huanglu22@hisilicon.com> # message auto-generated for no-merge-commit merge: !6575 merge master into master perf(machine): split LOCAL_READY_MATRIX slab type and trim aicpu-resolve stitch pool budget Created-by: lululu40888 Commit-by: huanglu Merged-by: cann-robot Description: perf(machine): split LOCAL_READY_MATRIX slab type and trim aicpu-resolve stitch pool budget See merge request: cann/pypto!6575 | 2 months ago | |
test(machine): Supplement machine UT test cases_7. Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !5255 merge ut_8 into master test(machine): Supplement machine UT test cases_7. Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: machine ut补充 See merge request: cann/pypto!5255 | 3 months ago | |
test(dfx): validate log calendar conversion against libc across 101 years Co-authored-by: W4termy<wangmingyang21@huawei.com> # message auto-generated for no-merge-commit merge: !6701 merge fix/log_localtime into master test(dfx): validate log calendar conversion against libc across 101 years Created-by: W4termy Commit-by: W4termy Merged-by: cann-robot Description: 日期算法补充前后50年与libc接口结果对比ut See merge request: cann/pypto!6701 | 2 months ago | |
test(machine): Supplement machine UT test cases. Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !4935 merge machine_ut into master test(machine): Supplement machine UT test cases. Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: PR 应该避免没有描述信息,描述信息的最重要的作用是描述修改意图,应该清晰明了。例如:标题中包含了 fix 标签,如果没有描述信息,就需要Review人员猜测PR具体修复了哪些内容,或者怀疑修改的必要性。如果PR和特定的Issue相关,可以单独包含一行 Related Issue: 放到描述信息最后。 下面是一个典型的PR描述信息: The origin issue template brings too many noise, it's not suitable for git message. eg: comments are not removed, labels are redundant as the PR tile already contains the tag. The guide gives a clear suggestion on how to write the PR body. Related Issue: #1234,#5678 更多描述信息见:[Commit Message 规范](../docs/zh/contribute/pull-request.md#commit-message) See merge request: cann/pypto!4935 | 4 months ago | |
test(machine): Supplement machine UT test cases_10. Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !5300 merge ut_11 into master test(machine): Supplement machine UT test cases_10. Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: machine ut补充 See merge request: cann/pypto!5300 | 3 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 3 months ago | ||
| 4 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 3 months ago | ||
| 2 months ago | ||
| 4 months ago | ||
| 3 months ago |