| Files | Last commit | Last update |
|---|---|---|
feat(ir): Keep int64 kwargs canonical and add narrowing accessors Co-authored-by: HuYiSheng01<hys123456aaa@163.com> # message auto-generated for no-merge-commit merge: !7673 merge feat/io_text_kwarg_int64 into master feat(ir): Keep int64 kwargs canonical and add narrowing accessors Created-by: HuYiSheng01 Commit-by: HuYiSheng01 Merged-by: cann-robot Description: ## 一、背景 ir.Call.kwargs_ 是 vector<pair<string, std::any>>。同一份 IR 由两条路径产生时,payload 类型不一致: | 路径 | compact=1 | dims=[1,2,3] | |---|---|---| | pro 前端(Python 构造 Call,经 ConvertKwargsDict) | int | vector<int> | | 文本 load(ParseAttrValueInt 等) | int64_t | vector<any> | 直跑(前端)时 codegen 拿到 int,GetKwarg<int> 正常;续跑(文本 load)拿到 int64_t,std::any_cast 严格匹配失败: Invalid type for kwarg key: l2_cache_mode, expected int, but got long - **IR 层统一存 int64_t / vector<int64_t>**(规范化数值表示); - **pro 操作接口需要 32 位时,由 IR 提供窄化取值接口**(带范围检查); - 非数值类型(DataType / MemorySpace / vector<string>)的还原放在后续 stacked PR,不在本 PR。 ## 二、改动 ### 1)IR 窄化接口 framework/include/core/any_cast.h cpp template <typename T> T AnyCastNarrow(const std::any& value, const std::string& context = ""); - 类型完全匹配 → 直接取值; - int64_t → 其它整型:范围检查后 static_cast,越界抛 TypeError; - vector<int64_t> → vector<int>:逐元素范围检查; - 其它 → 回退 AnyCast<T>(保留原有可读报错)。 接入点: | 文件 | 改动 | |---|---| | framework/include/ir/expr.h | Call::GetKwarg<T> 改用 AnyCastNarrow | | framework/include/ir/type_inference.h | GetOpKwarg<T> 改用 AnyCastNarrow | ### 2)前端绑定:存 canonical int64 python/src/bindings/ir/ir.cpp ConvertKwargsDict: - Python int → int64_t - Python 枚举的底层值 → int64_t - list[int] → vector<int64_t> Call.kwargs getter 增加 vector<int64_t> 分支,保证 Python 视图能读到新类型。 ### 3)消费点适配 | 文件 | 改动 | |---|---| | framework/src/interface/ir/op/dist_ops.cpp | std::any_cast<int> → AnyCastNarrow<int>;类型检查接受 int64_t | | framework/src/interface/ir/op/vf_ops.cpp | dist kwarg 改用 AnyCastNarrow | | framework/src/interface/pypto_pro/backend/common/backend_utils.cpp | cmp_mode / offset 改用 AnyCastNarrow | | framework/src/interface/pypto_pro/backend/backend_cce_block_out_ops.cpp | pattern_mode 改用 AnyCastNarrow | | framework/src/interface/ir/op_registry.cpp | std::vector<int> 契约同时接受 vector<int64_t>,读取时窄化 | See merge request: cann/pypto!7673 | 3 days ago | |
refactor(ir): Store PtrType element type as TypePtr Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !7790 merge ptr1 into master refactor(ir): Store PtrType element type as TypePtr Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Replace DataType dtype_ with TypePtr type_ so a pointer may point at non-scalar element types, and also remove two unused field. See merge request: cann/pypto!7790 | 1 day ago | |
add interface mark_stamp Co-authored-by: gaoxiang<gaoxiang26@huawei.com> # message auto-generated for no-merge-commit merge: !7513 merge mark_stamp into master add interface mark_stamp Created-by: gaoxiang618 Commit-by: gaoxiang Merged-by: cann-robot Description: 1. 增加pl.mark_stamp接口,用于在kernel侧打点 2. 前端增加if 和函数传参拦截,禁止返回类型是UnknownType和NoneType的Op作为if的条件和函数入参。 See merge request: cann/pypto!7513 | 2 days ago | |
feat(machine): Support offline compilation and packaging Co-authored-by: W4termy<wangmingyang21@huawei.com> # message auto-generated for no-merge-commit merge: !4974 merge jd into master feat(machine): Support offline compilation and packaging Created-by: W4termy Commit-by: W4termy Merged-by: cann-robot Description: 支持离线打包二进制 See merge request: cann/pypto!4974 | 3 months ago | |
feat(dist): Do some minor changes to dist feature Co-authored-by: tsungl4<lidongsheng4@huawei.com> Co-authored-by: tsungl4<lidongsheng@huawei.com> # message auto-generated for no-merge-commit merge: !7726 merge channel into master feat(dist): Do some minor changes to dist feature Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: Move distributed window channel management onto the HCCL communication object, and rename the "multi-issuer" window concept to "is_shared" to reflect what it actually means: all peers share one local UBC_CTP endpoint, so each AIV owns a private jetty. See merge request: cann/pypto!7726 | 3 days ago |