| 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 | |
fix(machine): Emit cell-match useList in topo order and skip zero-capacity READ fills Co-authored-by: Snow__Land<songyangyang18@huawei.com> # message auto-generated for no-merge-commit merge: !7045 merge topo into master fix(machine): Emit cell-match useList in topo order and skip zero-capacity READ fills Created-by: songyangyang18 Commit-by: Snow__Land Merged-by: cann-robot Description: ## 修改意图 1. 同 root 内对同一 tensor 连续写(典型是 assemble → view → assemble)时,cell-match 的 useList 原先按 callList 下标扫描。这个顺序不等于 CALL 依赖序,后写可能先于前写被登记,动态 stitch 建不齐,第二次写进不去。pure_vec_buf_waw_single(case 387,unroll_list=[1,2,8])上表现为精度停在 ×2,缺最后一次 ×1.5。 2. 单写者 root 的 slot 仍把 READ 容量门控成 0(outcastList.size() > 1 ? maxReadCount : 0)。Fill 遇到 maxCount == 0 的 READ 时直接返回 CELL_MATCH_OP_TYPE_NOT_SUPPORTED,后面的 NORMAL_WRITE 也不再写入。 ## 改动 1. **useList 按依赖拓扑序发射**(dev_encode.cpp) - 每个 root 在编码 incast/outcast 前做一次 Kahn 排序:边来自 callOpSuccDict,入度为 0 的点按 callList 下标入队,队列 FIFO。 - 只改 EncodeAnalysisOpUseOutCasts 的扫描顺序。callList 本身和 SortCallOpList 不动。 2. **READ 容量为 0 时跳过该条,不中断后续 Fill**(dev_encode_function_stitch.h) - maxCount == 0 :跳过这条 use,返回 0。 See merge request: cann/pypto!7045 | 1 month ago | |
fix(machine): Add metadata memory usage print Co-authored-by: duanhaotian<duanhaotian@huawei.com> # message auto-generated for no-merge-commit merge: !7289 merge duanhaotian into master fix(machine): Add metadata memory usage print Created-by: duanhaotian Commit-by: duanhaotian Merged-by: cann-robot Description: 新增元数据运行时使用率打印,每一轮devicetask下发时,打印每一类元数据的当前使用量,总评估量,地址分布 See merge request: cann/pypto!7289 | 25 days 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 | |
fix(machine): Stabilize log timestamp format tests Co-authored-by: W4termy<wangmingyang21@huawei.com> # message auto-generated for no-merge-commit merge: !7264 merge fix/timebug into master fix(machine): Stabilize log timestamp format tests Created-by: W4termy Commit-by: W4termy 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!7264 | 28 days 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 | ||
| 1 month ago | ||
| 25 days ago | ||
| 3 months ago | ||
| 28 days ago | ||
| 4 months ago | ||
| 3 months ago |