| Files | Last commit | Last update |
|---|---|---|
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
test(ir): Add text check for test_merge_pass Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5209 merge ir into master test(ir): Add text check for test_merge_pass Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: 1. support name propgration 2. fix some determine issue 3. add text check for test_merge_pass 4. fix gcov for python ut 5. remove python/pypto/ir folder Related Issue: #2559 See merge request: cann/pypto!5209 | 3 months ago | |
fix(operation): Fix lrelu fp16 precision and negative_slope validation Co-authored-by: raoliang_sac<raoliang4@huawei.com> # message auto-generated for no-merge-commit merge: !5230 merge fix-lrelu-precision-and-validation into master fix(operation): Fix lrelu fp16 precision and negative_slope validation Created-by: raoliang_sac Commit-by: raoliang_sac Merged-by: cann-robot Description: ## 问题描述 pypto.lrelu 算子存在两个问题: ### 问题1:FP16/BF16 精度与 torch_npu 不一致 当输入 tensor 为 fp16/bf16 时,negative_slope(创建为 Element(DT_FP32))被 C++ 层 BinaryOperationScalar 截断为输入 dtype,导致硬件指令 TLRELU 做 fp16×fp16→fp16 乘法。而 torch_npu F.leaky_relu 和 AscendC leaky_relu 算子均在 fp32 下计算后 Cast 回原类型,两者精度存在系统性差异。 ### 问题2:negative_slope 缺少负数/NaN/inf 校验 negative_slope 接受负数、NaN、inf 时无报错,违反文档约束"必须为非负实数(≥ 0),不支持 nan、inf"。 ## 根因分析 **问题1根因链**: - 硬件指令 TLRELU(pto-isa/include/pto/npu/a2a3/TLRelu.hpp:59)要求 scalar 类型与 tile 类型一致 - Python 层 math.py:442 创建 Element(DT_FP32, negative_slope),但 C++ binary.cpp:1142 的 BinaryOperationScalar 将其截断为输入 dtype - AscendC leaky_relu 算子(leaky_relu_apt.cpp:34-38)通过 LeakyReluCastDag(leaky_relu_dag.h:68-78)正确处理:CopyIn<half> -> Cast<float> -> Muls(fp32 slope) -> Cast<half> -> CopyOut **问题2根因**:lrelu 函数缺少参数校验逻辑 ## 修复方案 ### 问题1:fp16/bf16 输入内部提升到 fp32 计算 参照 AscendC leaky_relu 算子和 Atan2 算子的处理模式,在 Python 层对 fp16/bf16 输入做: 1. Cast(input, DT_FP32) — 提升到 fp32 2. LReLU(fp32_input, fp32_slope) — 在 fp32 下计算 3. Cast(result, orig_dtype) — Cast 回原类型 同时统一 negative_slope 始终转为 Element(DT_FP32, ...),无论传入 float 还是 Element。 ### 问题2:添加 negative_slope 校验 对 negative_slope 值检查: - 负数 -> PyptoError(ValueError("negative_slope must be non-negative")) - NaN -> PyptoError(ValueError("negative_slope must not be NaN")) - inf -> PyptoError(ValueError("negative_slope must not be inf")) ## 验证结果 ### 精度验证(759x392 fp16, alpha=0.182676732) | 指标 | 修复前 | 修复后 | torch_npu | |------|--------|--------|-----------| | RMSE vs golden | 0.0016153 | **0.0007846** | 0.0007846 | | RMSE ratio | 2.0589 | **1.000000** | 1.0 | | 20 seed 通过率 | 12/20 PASS | **20/20 PASS** | - | | 逐元素一致性 | 有差异 | **完全一致** | - | ### 拦截验证 | 输入 | 修复前 | 修复后 | |------|--------|--------| | negative_slope=-0.1 | 无报错 | **PyptoError(ValueError)** | | negative_slope=NaN | 无报错 | **PyptoError(ValueError)** | | negative_slope=inf | 无报错 | **PyptoError(ValueError)** | | fp32 基础功能 | PASS | **PASS(无回归)** | ## 变更文件 | 文件 | 变更说明 | |------|---------| | python/pypto/op/math.py | fp16/bf16 输入 Cast->fp32 计算->Cast 回;统一 slope 为 DT_FP32;添加负数/NaN/inf 校验 | | docs/zh/api/operation/pypto-lrelu.md | 更新参数说明和约束说明,删除"fp16不保证正确性",改为"fp32内部计算后Cast回原类型" | Related Issue: #2853 See merge request: cann/pypto!5230 | 3 months ago | |
fix(ir): Support legacy is_loop_begin/end cross function | 3 months ago | |
fix(ir): Remove redundant yield args for inner loop Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5179 merge temp into master fix(ir): Remove redundant yield args for inner loop Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: 1. tensor maybe moved during excuting, addition checkout/restore are needed 2. fix redundant yield values not remove correcly Related Issue: #1185 See merge request: cann/pypto!5179 | 3 months ago | |
refactor(api): replace Vf class *args/**kwargs with explicit signatures Co-authored-by: gravel1997<shili19@huawei.com> # message auto-generated for no-merge-commit merge: !4982 merge pro_kw_fix into master refactor(api): replace Vf class *args/**kwargs with explicit signatures Created-by: gravel1997 Commit-by: gravel1997 Merged-by: cann-robot Description: refactor(api): replace Vf class *args/**kwargs with explicit signatures Related Issue: [#2702](https://gitcode.com/cann/pypto/issues/2702) See merge request: cann/pypto!4982 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
fix(examples): Add success messages to basic examples Co-authored-by: zhaojunhan<zhaojunhan1@huawei.com> # message auto-generated for no-merge-commit merge: !5025 merge fix-examples-success-messages into master fix(examples): Add success messages to basic examples Created-by: zhaojunhan Commit-by: zhaojunhan Merged-by: cann-robot Description: - hello_world 和 basic_ops 用例执行成功后缺少明确提示,用户难以从终端输出判断用例是否已完成。 - 修复hello_world.py run_mode=sim配置不生效 - 修复多余logging日志打印 See merge request: cann/pypto!5025 | 4 months ago | |
fix(interface): Unify PYPTO log macros and add level check Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !3118 merge pypto_log into master fix(interface): Unify PYPTO log macros and add level check Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: 1. 修复通用日志接口 缺少日志级别检查的问题 2. 重构PYPTO_LOG宏,减少重复代码 3. 补充python前端错误码使用 See merge request: cann/pypto!3118 | 6 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
feat(ir): Create root function Co-authored-by: zhuqingbo<zhuqingbo@huawei.com> # message auto-generated for no-merge-commit merge: !3758 merge aa into master feat(ir): Create root function Created-by: gcw_zcOFYzUr Commit-by: zhuqingbo Merged-by: cann-robot Description: 主要完成3个转换: * IR上的条件语句合并 * 推导token * 生成function See merge request: cann/pypto!3758 | 5 months ago | |
test(ir): Add text check for test_merge_pass Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5209 merge ir into master test(ir): Add text check for test_merge_pass Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: 1. support name propgration 2. fix some determine issue 3. add text check for test_merge_pass 4. fix gcov for python ut 5. remove python/pypto/ir folder Related Issue: #2559 See merge request: cann/pypto!5209 | 3 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
style(all): Fix ruff-check lint errors across the codebase Co-authored-by: junjieHuang<huangjunjie38@h-partners.com> # message auto-generated for no-merge-commit merge: !4934 merge style-python-format into master style(all): Fix ruff-check lint errors across the codebase Created-by: junjieHuang Commit-by: junjieHuang Merged-by: cann-robot Description: Fix ruff-check lint errors across the codebase See merge request: cann/pypto!4934 | 4 months ago | |
fix(ir): Remove redundant yield args for inner loop Co-authored-by: tsungl4<lidongsheng4@huawei.com> # message auto-generated for no-merge-commit merge: !5179 merge temp into master fix(ir): Remove redundant yield args for inner loop Created-by: tsungl4 Commit-by: tsungl4 Merged-by: cann-robot Description: 1. tensor maybe moved during excuting, addition checkout/restore are needed 2. fix redundant yield values not remove correcly Related Issue: #1185 See merge request: cann/pypto!5179 | 3 months ago |
| Files | Last commit | Last update |
|---|---|---|
| 4 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 3 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 6 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 5 months ago | ||
| 3 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 4 months ago | ||
| 3 months ago |