| Files | Last commit | Last update |
|---|---|---|
refactor(ir): drop the unused INDEX dtype Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !7713 merge feat/io_text_drop_index_dtype into master refactor(ir): drop the unused INDEX dtype Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: ## 一、背景 DataType::INDEX(kIndexCode = 0x15)是历史上为"索引型 64 位整数"保留的占位类型,实际语义与 INT64 完全重复: - 与 INT64 共用同一个 C 类型串:DataType::GetDataTypeCTypeStringDict() 里同时有 {kInt64Code, "int64_t"} 和 {kIndexCode, "int64_t"}; - BiMap 的反查是 str2typeDict[s] = i(后写覆盖),导致 Find("int64_t") 返回的是 INDEX 而不是 INT64; - 为此在文本 load 和 kwarg 读取侧被迫加了特判: - io_text_loader.cpp 的 TryDTypeFromCTypeString(text, preferInt64)(pro/v0 门控); - AnyCastFromIR<DataType> 里的 if (text == "int64_t") return kInt64Code;; - 反向不唯一还带出另一个坑:{kHf4Code, "unknown"} 使 "unknown" 反查到 HF4。 评审确认 INDEX 已无真实使用点(所有出现都是"等价于 INT64"的类型标注),因此整体删除。 ## 二、改动 ### 1)dtype 定义(framework/include/core/dtype.h) - 删除 kIndexCode、DataType::INDEX 声明与定义; - 删除 BiMap 中的 {kIndexCode, IR_KW_TYPE_INT64}(反查恢复唯一,"int64_t" → INT64); - 删除 GetBit() 的 case kIndexCode、ToString() 的 "index" 分支、DTypeToString() 的 "INDEX" 分支。 ### 2)结构性去重(structural_hash.cpp / structural_equal.cpp) - 删除 CanonicalizeForSyntaxScalarDtype() / AreForSyntaxScalarDtypesEquivalent(); - 删除仅为该归一化存在的上下文机制:fieldNameStack_、IsLoopVarFieldContext()、IsConstIntTypeContext(); - structural_hash 的 nodeTypeStack_ 一并移除(仅该归一化使用);structural_equal 保留 nodeTypeStack_(assert 模式错误路径仍在用)。 ### 3)消费侧去掉冗余判断 - scalar_expr_ops.h:删除 INDEX↔INT64 免 Cast 分支; - atomic.cpp / sync.cpp / ptr_ops.cpp:dtype_.IsInt() || == INDEX → dtype_.IsInt(); - debug_ops.cpp:删除 IsPrintfIndexType() 及 6 处引用,同步精简报错文案; - backend_cce_ops.cpp / backend_cce_vf_ops.cpp / backend_cce_block_out_ops.cpp:删除 == INDEX 分支与注释里的 INDEX 说明。 ### 4)Python 侧 - bindings/ir/ir.cpp:删除 DataType.INDEX 只读属性; - python/pypto/ir.py:删除 INDEX = DataType.INDEX 别名,tuple_get_item() 内部改用 DataType.INT64; - python/pypto_pro/ir/op/debug_ops.py:删除 _is_index_dtype() 及其引用; - python/pypto_pro/language/parser/_gemm_lowering.py:类型校验改为 dtype.is_int(); - python/pypto_pro/runtime/jit.py:删除 (DataType.INDEX, "int64") 与 str(DataType.INDEX): ctypes.c_int64(INT64 已有对应项)。 ### 5)测试 - 14 个 Python 用例文件:ir.INDEX / DataType.INDEX → INT64; - 18 个 C++ UT 文件:DataType::INDEX → DataType::INT64; - 删除只验证"INDEX 存在"的用例: - test_structural_equal_ext.cpp:TestLoopVarInt64IndexNotEquivalent、TestConstIntTypeInt64IndexNotEquivalent; - test_dtype.py:test_limits_of_index_matches_int64; - test_scalar_range.py:test_explicit_legacy_index_dtype_is_preserved; - test_backend_cce_vf_ops.cpp:删除重复的 IndexVal 用例,测试更名为 MulsAcceptsInt64ScalarConvertedToSrcType。 ### 6)文档 - docs/zh|en/.../basic_data_structures/DataType.md:删除 static const DataType INDEX; 行(中英同步,保持原 CRLF 行尾)。 ## 三、行为变化(对外可见) | 场景 | 改动前 | 改动后 | |---|---|---| | GetDataTypeCTypeStringDict().Find("int64_t") | INDEX | INT64 | | v0 文本 incast(int64_t %a) 的 dtype | INDEX | INT64 | | DataType.INDEX / ir.INDEX | 存在 | **不存在**(调用方需改用 INT64) | | str(DataType.INDEX) | "index" | 类型已删除 | | structural hash/equal 的 INT64≡INDEX 归一化 | 存在 | 不再需要(两者本就是一个类型) | | debug.printf/assert 的 index 标量 | 单独归类 | 按 INT64 处理(行为等价) | **兼容性**:IR 文本不变(int64_t 前后一致);不涉及序列化格式;只影响直接使用 DataType.INDEX 的 C++/Python 调用点,本 PR 已全部迁移。 See merge request: cann/pypto!7713 | 7 days ago | |
support builtifying msprof profiling | 6 days ago | |
feat(ir): Add block bindings support Co-authored-by: wuzhongxin<wuzhongxin1@huawei.com> # message auto-generated for no-merge-commit merge: !3705 merge new into master feat(ir): Add block bindings support Created-by: wuzhongxin Commit-by: wuzhongxin Merged-by: cann-robot Description: support block bindings See merge request: cann/pypto!3705 | 5 months ago | |
feat(pass): Gate VF cluster fusion on unroll branch id Co-authored-by: Catherie<mayuan33@huawei.com> # message auto-generated for no-merge-commit merge: !7693 merge feat/vf-unroll-branch-gating into master feat(pass): Gate VF cluster fusion on unroll branch id Created-by: Catherie Commit-by: Catherie Merged-by: cann-robot Description: ## 背景 跨 unroll 分支的 VF 融合会让簇闸门同时持有全部分支的输入链,顺序驻留峰值被推过片上池上限,触发本可避免的 spill。本 PR 为 op 标注一个调度提示属性(unroll 分支号),并据此门控 VF 簇的形成。 ## 修改点 - 前端(pypto.loop / loop_unroll / static_for)在分发每个编译期循环体拷贝时,经新增的 SetUnrollBranchId / GetUnrollBranchId 绑定分配新的 unroll 分支号;循环退出时恢复外层分支号(嵌套循环保持外层分支) - Function::AddRawOperation 在分支上下文激活时为新建 op 盖章 UNROLL_BRANCH_ID 属性;ExpandFunction 将该属性继承到展开产生的 tile op - VFFusionClusterIdentify 在 consumer-merge 与 cluster-merge 两条合并路径上拒绝跨不同分支号的融合;未展开循环内记录的 op(无分支号,-1)视为通配,不受限 - 该属性是纯调度提示,不参与 CommonOperationEliminate 等价哈希,并在 op JSON dump 中提为一等字段 unrollBand 便于排查 - 测试:新增 6 个 C++ UT 用例(盖章、簇分支号分类、两条门控路径、通配融合)与 4 个 Python UT 用例(TLS 回读、循环 band 生命周期、嵌套循环恢复外层 band、loop_unroll 每次分发独立 band) See merge request: cann/pypto!7693 | 9 days ago | |
fix(simulation): Relax capture mode during device-to-host data transfer Co-authored-by: zhiweiyuan<zhiweiyuan@huawei.com> # message auto-generated for no-merge-commit merge: !5303 merge fix/capture-mode-relax into master fix(simulation): Relax capture mode during device-to-host data transfer Created-by: zhiweiyuan Commit-by: zhiweiyuan Merged-by: cann-robot Description: fix(simulation): Relax capture mode during device-to-host data transfer In A3 simulation mode, executing capture test cases fails with RT_MEMCPY_FAILED (F7B002) during CopyFromDev. The root cause is that device-to-host memory copy is restricted in capture mode. This change calls ExchangeCaptureModeRelax before the data transfer to relax the capture mode constraint, allowing the memcpy to succeed. Changes: - Add ExchangeCaptureModeRelax call in cost_model.py before device-to-host tensor transfer - Bind ExchangeCaptureModeRelax function in cost_model.cpp - Add ExchangeCaptureModeRelax declaration in __init__.pyi Related Issues: #2887 See merge request: cann/pypto!5303 | 3 months ago | |
feat(dist): Support register memory_region Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !7421 merge win into master feat(dist): Support register memory_region Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #3562 See merge request: cann/pypto!7421 | 21 days ago | |
feat(ir): Add block bindings support Co-authored-by: wuzhongxin<wuzhongxin1@huawei.com> # message auto-generated for no-merge-commit merge: !3705 merge new into master feat(ir): Add block bindings support Created-by: wuzhongxin Commit-by: wuzhongxin Merged-by: cann-robot Description: support block bindings See merge request: cann/pypto!3705 | 5 months ago | |
feat(pypto_pro):unified error codes Co-authored-by: huanyongben<huanyongben1@hisilicon.com> # message auto-generated for no-merge-commit merge: !6453 merge master into master feat(pypto_pro):unified error codes Created-by: huanyongben Commit-by: huanyongben Merged-by: cann-robot Description: pypto pro整改错误码以及日志规范 See merge request: cann/pypto!6453 | 2 months ago | |
refactor(machine): Drop execute-path RUNTIME_SlotMarkNeedAlloc covered by path marking Co-authored-by: songyangyang18<songyangyang18@huawei.com> # message auto-generated for no-merge-commit merge: !6754 merge clean into master refactor(machine): Drop execute-path RUNTIME_SlotMarkNeedAlloc covered by path marking Created-by: songyangyang18 Commit-by: songyangyang18 Merged-by: cann-robot Description: ## 问题背景: Execute 图上的 NeedAlloc 标记曾用于修复非 assemble 算子(如 pypto.full), 产出的 assemble 目标漏发 RUNTIME_SlotMarkNeedAlloc 的问题。 目前,IR builder 会把所有非 assemble 生产者记录到 tensorConstructFunc_,PATH 级标记constructAssembleSlotList已经覆盖这些 slot,Execute 图上的标记因此变得冗余。 ## 删除的安全性: - 每个 PATH 只有一个 root,PATH 级标记在 PATH 入口发出,早于该 root 的 RUNTIME_RootAlloc。Execute 图标记的非参数 slot 都已被 PATH 标记过,且该标志是幂等的。 - Execute 图额外标记的只有 kernel 参数 slot。运行时 ResolveOutcastAddress 对这些 slot走外部 IO 分支,从不读取 NeedAlloc 标志,因此这些标记本身不起作用。 - 作用:参数 slot 不再计入 constructAssembleNeedAllocRuntimeSlots,totalAssembleOutcastSlot 不再为它们多预留 InnerTemporal slot。 ## 问题样例: 下面的算子,out会被错误纳入assemble outcast内存分配,去掉excute路径,恢复正常。 @pypto.frontend.jit(**_JIT) def _k_out_compute_then_assemble(src: _T, out: _T): pypto.set_vec_tile_shapes(TILE, TILE) out[:] = pypto.mul(src.view([BS, HIDDEN], [0, 0]), 2.0) for i in pypto.loop(N_ROW, name="NA_OCA", idx_name="i"): pypto.set_vec_tile_shapes(TILE, TILE) v = src.view([TILE, HIDDEN], [i * TILE, 0]) pypto.assemble(pypto.mul(v, 4.0), [i * TILE, 0], out) See merge request: cann/pypto!6754 | 1 month ago | |
feat(ops): Add NaN propagation control to extrema operators Co-authored-by: bynshard<zhangbingshuai@huawei.com> # message auto-generated for no-merge-commit merge: !7435 merge codex/propagate-nan-current into master feat(ops): Add NaN propagation control to extrema operators Created-by: bynshard Commit-by: bynshard Merged-by: cann-robot Description: 为 amax、 amin、argmax、argmin、maximum 和 minimum 增加编译期参数 propagate_nan,默认值为 True。 默认模式及显式 True 沿用原生实现,包括索引选择行为、类型转换和临时空间。浮点输入显式指定 False 时忽略 NaN,全 NaN 的数值规约返回 NaN,索引规约返回 0。 See merge request: cann/pypto!7435 | 11 days ago | |
feat(ir): Add block bindings support Co-authored-by: wuzhongxin<wuzhongxin1@huawei.com> # message auto-generated for no-merge-commit merge: !3705 merge new into master feat(ir): Add block bindings support Created-by: wuzhongxin Commit-by: wuzhongxin Merged-by: cann-robot Description: support block bindings See merge request: cann/pypto!3705 | 5 months ago | |
feat(pypto-pro): Support_a6 Co-authored-by: gravel1997<shili19@huawei.com> # message auto-generated for no-merge-commit merge: !7176 merge a6_support into master feat(pypto-pro): Support_a6 Created-by: gravel1997 Commit-by: gravel1997 Merged-by: cann-robot Description: feat(pypto-pro): Support_a6 Related Issue: [#3666](https://gitcode.com/cann/pypto/issues/3666) See merge request: cann/pypto!7176 | 26 days ago | |
feat(dfx): Simplify compiler monitor timeout reporting Co-authored-by: chai-hw<chaizhengtong@huawei.com> # message auto-generated for no-merge-commit merge: !7343 merge new_monitor into master feat(dfx): Simplify compiler monitor timeout reporting Created-by: chai-hw Commit-by: chai-hw Merged-by: cann-robot Description: 删除compile_timeout_stage 和 compile_monitor_print_interval 两个超时检测的配置项 以及相关内容 See merge request: cann/pypto!7343 | 24 days ago | |
style(all): Apply additional clang-format corrections across codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4883 merge style-cpp into master style(all): Apply additional clang-format corrections across codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Apply additional clang-format corrections across codebase See merge request: cann/pypto!4883 | 4 months ago | |
fix(ir): Select merged valid_shape by branch condition Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5840 merge fix/phi-shape into master fix(ir): Select merged valid_shape by branch condition Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Related Issue: #2559 See merge request: cann/pypto!5840 | 2 months ago | |
fix(frontend): resolve CodeCheck G.FMT/G.STD/G.CNS/G.PRE/G.EXP/G.SCRIPT warnings Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !6515 merge master into master fix(frontend): resolve CodeCheck G.FMT/G.STD/G.CNS/G.PRE/G.EXP/G.SCRIPT warnings Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: ## 背景 CodeCheck代码规范缺陷列表,共 3 个检查任务、去重后 13 处缺陷、9 个文件(C/C++ 双扫导致的重复项已合并)。 ## 改动概览 涉及模块: framework/src/interface/{utils,tensor,function}、python/src/bindings ## 已修复项 | 规范 | 文件 | 修复方式 | |---|---|---| | G.FMT.17-CPP | torch_tensor_converter.cpp | 删除返回值判断前的多余空行 | | G.CNS.02-CPP | symbolic_scalar_simplify.h | magic number 4/2/3 → 0x4/2/3 | | G.CNS.02-CPP | function.cpp | magic number 62 → 具名常量 | | G.CNS.02-CPP | controller.cpp | magic number 2 → 0x2 | | G.PRE.09 | rebuildable_attribute.h | 宏末尾去除分号(调用处已带分号,3 处调用已验证) | | G.EXP.09-CPP | symbolic_scalar.cpp | 递归 lambda 变量声明即初始化 | See merge request: cann/pypto!6515 | 2 months ago | |
style(all): Apply additional clang-format corrections across codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4883 merge style-cpp into master style(all): Apply additional clang-format corrections across codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Apply additional clang-format corrections across codebase See merge request: cann/pypto!4883 | 4 months ago | |
feat(ir): Add block bindings support Co-authored-by: wuzhongxin<wuzhongxin1@huawei.com> # message auto-generated for no-merge-commit merge: !3705 merge new into master feat(ir): Add block bindings support Created-by: wuzhongxin Commit-by: wuzhongxin Merged-by: cann-robot Description: support block bindings See merge request: cann/pypto!3705 | 5 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 7 days ago | ||
| 6 days ago | ||
| 5 months ago | ||
| 9 days ago | ||
| 3 months ago | ||
| 21 days ago | ||
| 5 months ago | ||
| 2 months ago | ||
| 1 month ago | ||
| 11 days ago | ||
| 5 months ago | ||
| 26 days ago | ||
| 24 days ago | ||
| 4 months ago | ||
| 2 months ago | ||
| 2 months ago | ||
| 4 months ago | ||
| 5 months ago |