| Files | Last commit | Last update |
|---|---|---|
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !5941 merge fix/issue3-assemble-no-start-offset into master fix(tensor): Fix assemble offset for slice assignment without start and IR dump update Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: loop 循环中 assemble 写法不带起始 start 偏移量时存在精度问题。典型写法: output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, :h] = left # "[:h]" 不带 start output_tensor[b_idx * tile_b:(b_idx + 1) * tile_b, h:] = right Issue 中最小复现(test_coe_issue.py 1)triple-compare 精度 FAILED,IR 偏移证据为 to offset:[0,-64] to dynoffset:[...,-64]。 修复 Tensor._get_assemble_offset 对 slice(None, stop) 的偏移错算,使不带 start 的切片赋值写入正确位置。 按 Python 切片语义,切片起始位置即写入偏移——start 为 None 时 offset 置 0,否则为 start。同步清理不再使用的 stop/axis 局部变量。 此外,IR 文本 dump 能力增强 IRTextDumper::PrintAttrValue 缺少 std::vector<SymbolicScalar> 类型分支,导致 assemble/view 属性中的动态偏移(toOffset、fromOffset、toValidShape 等)序列化为 "Unsupported" 新增缺失分支,复用文件内已有的 VisitScalarExpr::Visit 打印器。[expr, expr] 列表格式符合 attr_value_list 文法,IRTextLoader round-trip 不受影响 新增 assemble_offset/ IR 快照回归测试(复刻 issue kernel 场景,pil.compile + check_snapshot);重渲染 94 个受影响黄金文件(Unsupported → 真实偏移表达式) Related Issue: #3216 See merge request: cann/pypto!5941 | 2 months ago | |
feat(io_text): Round-trip tile shapes, generic op attrs, and scalar types Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !7144 merge feat/io_text_fidelity into master feat(io_text): Round-trip tile shapes, generic op attrs, and scalar types Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: IR 文本格式(io_text)用于 checkpoint / resume:先把 IR dump 成文本,之后再 load 回来并重新 dump。 上一笔改动(已合入 master:"Emit lexable names and dump attrs in canonical order")解决了变量名可词法化、 以及属性顺序规范化的基础问题;但 load → dump 往返仍会静默丢失若干**文本/属性层面**的信息,导致 checkpoint 后的程序无法被忠实恢复。本 PR 补齐这些信息,并保证 dump → load → dump 的稳定性。 二、改动内容(只有文本与加载逻辑;IR 语义的改动见后续 PR) - dumper(输出文本): * 输出**算子级** tile 属性(vec / cube / dist); * 输出可往返的通用算子属性(白名单,排除 offset 等由 view/assemble 显式处理的保留键); * Element 值按浮点全精度( max_digits10)打印,且**不污染**后续属性输出的精度(局部流,不是 在成员流上设置后不恢复);支持 [elem, <dtype>, <data>] / [scal, <expr>] 标签化值形式; * 支持空属性值形式 #entry()。 - loader(读取文本,即 dump 的逆操作): * 恢复**算子级** tile(SetOpTileShape)与通用算子属性(SetOpGenericAttr,含 elem/scal 解包); * 由 #shape 重建 raw tensor 的**动态形状**(SetTensorAttrDict),否则下游读 GetDynRawShape 拿不到; * 变量名中的 @rawmagic 变为**可选**:缺失或非数字时返回带位置信息的错误,而不是 std::stoi 抛异常逃出公开 API 导致进程终止; * 只对"全为整数"的列表按 vector<int64_t> 恢复,其它类型显式报错(不再盲目 AnyCast<int64_t> 产生静默错值);符号标量属性恢复失败时也上报错误,不再静默丢弃。 - Python:暴露 text_dump / text_dump_type / text_load_program / text_load_function / text_load_stmt / text_load_expr / text_load_type(纯接口暴露,不改任何 IR 行为)。 - 基准与快照:新增 golden generic_attrs_precision.pypto(Element 全精度等);按新基准重生成受影响的 .pypto 快照。 See merge request: cann/pypto!7144 | 1 month ago |
| Files | Last commit | Last update |
|---|---|---|
| 2 months ago | ||
| 2 months ago | ||
| 1 month ago |