| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
style: ruff 配置行宽 120 并关闭 magic trailing comma Co-authored-by: zhangyujia77<zhangyujia37@huawei.com> # message auto-generated for no-merge-commit merge: !6286 merge style/ruff-line-length-120 into master style: ruff 配置行宽 120 并关闭 magic trailing comma Created-by: zhangyujia77 Commit-by: zhangyujia77 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ruff.toml 新增两项配置并据此重排全仓 Python 代码: line-length = 120 行宽从默认 88 放宽到 120 [format] skip-magic-trailing-comma = true 忽略末尾逗号的强制展开语义 ### 为什么改 line-length ruff 的 line-length 此前**从未在仓库任何地方配置过** —— ruff.toml 只设了target-version,全仓搜 line-length 零命中,pre-commit 的 ruff hook 也没传参。 所以生效值 88 是 ruff 内置默认(沿用 Black 的约定),**不是评估过的技术决策**: $ ruff check --show-settings Settings path: ".../asc-devkit/ruff.toml" linter.line_length = 88 120 有三层依据: 1. **本仓 C++ 侧已定 120** —— .clang-format: ColumnLimit: 120。同一仓库 C++ 120、Python 88 本身不一致。 2. **CANN 生态其余 Python 仓统一为 120** —— pyasc、pypto、pto-isa、ops-test-kit、vllm-ascend(ruff),torch_npu、pytorch(flake8)。asc-devkit 是其中唯一没配的。 3. **本仓 Python 历史上事实遵守 120** —— ruff-format 落地前,非空行 P99.5 = 119,99.82% 的行 ≤ 120;超 120 的 38 行基本是嵌在 Python 里的 C++ 模板与宏定义。 88 列会把多参数调用强制拆成逐参数一行,一条语句常常变 3-5 行: python # 前(1 行) raise RuntimeError("Length of ASCENDC_TPL_UINT_{} {} is too short.".format(self.macro_type, self.name)) # 后(5 行) raise RuntimeError( "Length of ASCENDC_TPL_UINT_{} {} is too short.".format( self.macro_type, self.name ) ) ### 为什么关 magic trailing comma 末尾逗号会让 ruff-format 强制保持展开,即使该行放得下。统计范围内现存 886 处此类逗号,**绝大多数是 88 列时期 ruff 自己折行时补上的,并非作者意图** ——换到 120 列后这些调用本可收拢,却因那个自动留下的逗号继续保持展开。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [x] 🧹 chore: 代码格式修改 See merge request: cann/asc-devkit!6286 | 13 小时前 | |
style: ruff 配置行宽 120 并关闭 magic trailing comma Co-authored-by: zhangyujia77<zhangyujia37@huawei.com> # message auto-generated for no-merge-commit merge: !6286 merge style/ruff-line-length-120 into master style: ruff 配置行宽 120 并关闭 magic trailing comma Created-by: zhangyujia77 Commit-by: zhangyujia77 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ruff.toml 新增两项配置并据此重排全仓 Python 代码: line-length = 120 行宽从默认 88 放宽到 120 [format] skip-magic-trailing-comma = true 忽略末尾逗号的强制展开语义 ### 为什么改 line-length ruff 的 line-length 此前**从未在仓库任何地方配置过** —— ruff.toml 只设了target-version,全仓搜 line-length 零命中,pre-commit 的 ruff hook 也没传参。 所以生效值 88 是 ruff 内置默认(沿用 Black 的约定),**不是评估过的技术决策**: $ ruff check --show-settings Settings path: ".../asc-devkit/ruff.toml" linter.line_length = 88 120 有三层依据: 1. **本仓 C++ 侧已定 120** —— .clang-format: ColumnLimit: 120。同一仓库 C++ 120、Python 88 本身不一致。 2. **CANN 生态其余 Python 仓统一为 120** —— pyasc、pypto、pto-isa、ops-test-kit、vllm-ascend(ruff),torch_npu、pytorch(flake8)。asc-devkit 是其中唯一没配的。 3. **本仓 Python 历史上事实遵守 120** —— ruff-format 落地前,非空行 P99.5 = 119,99.82% 的行 ≤ 120;超 120 的 38 行基本是嵌在 Python 里的 C++ 模板与宏定义。 88 列会把多参数调用强制拆成逐参数一行,一条语句常常变 3-5 行: python # 前(1 行) raise RuntimeError("Length of ASCENDC_TPL_UINT_{} {} is too short.".format(self.macro_type, self.name)) # 后(5 行) raise RuntimeError( "Length of ASCENDC_TPL_UINT_{} {} is too short.".format( self.macro_type, self.name ) ) ### 为什么关 magic trailing comma 末尾逗号会让 ruff-format 强制保持展开,即使该行放得下。统计范围内现存 886 处此类逗号,**绝大多数是 88 列时期 ruff 自己折行时补上的,并非作者意图** ——换到 120 列后这些调用本可收拢,却因那个自动留下的逗号继续保持展开。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [x] 🧹 chore: 代码格式修改 See merge request: cann/asc-devkit!6286 | 13 小时前 | |
style: ruff 配置行宽 120 并关闭 magic trailing comma Co-authored-by: zhangyujia77<zhangyujia37@huawei.com> # message auto-generated for no-merge-commit merge: !6286 merge style/ruff-line-length-120 into master style: ruff 配置行宽 120 并关闭 magic trailing comma Created-by: zhangyujia77 Commit-by: zhangyujia77 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ruff.toml 新增两项配置并据此重排全仓 Python 代码: line-length = 120 行宽从默认 88 放宽到 120 [format] skip-magic-trailing-comma = true 忽略末尾逗号的强制展开语义 ### 为什么改 line-length ruff 的 line-length 此前**从未在仓库任何地方配置过** —— ruff.toml 只设了target-version,全仓搜 line-length 零命中,pre-commit 的 ruff hook 也没传参。 所以生效值 88 是 ruff 内置默认(沿用 Black 的约定),**不是评估过的技术决策**: $ ruff check --show-settings Settings path: ".../asc-devkit/ruff.toml" linter.line_length = 88 120 有三层依据: 1. **本仓 C++ 侧已定 120** —— .clang-format: ColumnLimit: 120。同一仓库 C++ 120、Python 88 本身不一致。 2. **CANN 生态其余 Python 仓统一为 120** —— pyasc、pypto、pto-isa、ops-test-kit、vllm-ascend(ruff),torch_npu、pytorch(flake8)。asc-devkit 是其中唯一没配的。 3. **本仓 Python 历史上事实遵守 120** —— ruff-format 落地前,非空行 P99.5 = 119,99.82% 的行 ≤ 120;超 120 的 38 行基本是嵌在 Python 里的 C++ 模板与宏定义。 88 列会把多参数调用强制拆成逐参数一行,一条语句常常变 3-5 行: python # 前(1 行) raise RuntimeError("Length of ASCENDC_TPL_UINT_{} {} is too short.".format(self.macro_type, self.name)) # 后(5 行) raise RuntimeError( "Length of ASCENDC_TPL_UINT_{} {} is too short.".format( self.macro_type, self.name ) ) ### 为什么关 magic trailing comma 末尾逗号会让 ruff-format 强制保持展开,即使该行放得下。统计范围内现存 886 处此类逗号,**绝大多数是 88 列时期 ruff 自己折行时补上的,并非作者意图** ——换到 120 列后这些调用本可收拢,却因那个自动留下的逗号继续保持展开。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [x] 🧹 chore: 代码格式修改 See merge request: cann/asc-devkit!6286 | 13 小时前 | |
style: ruff 配置行宽 120 并关闭 magic trailing comma Co-authored-by: zhangyujia77<zhangyujia37@huawei.com> # message auto-generated for no-merge-commit merge: !6286 merge style/ruff-line-length-120 into master style: ruff 配置行宽 120 并关闭 magic trailing comma Created-by: zhangyujia77 Commit-by: zhangyujia77 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ruff.toml 新增两项配置并据此重排全仓 Python 代码: line-length = 120 行宽从默认 88 放宽到 120 [format] skip-magic-trailing-comma = true 忽略末尾逗号的强制展开语义 ### 为什么改 line-length ruff 的 line-length 此前**从未在仓库任何地方配置过** —— ruff.toml 只设了target-version,全仓搜 line-length 零命中,pre-commit 的 ruff hook 也没传参。 所以生效值 88 是 ruff 内置默认(沿用 Black 的约定),**不是评估过的技术决策**: $ ruff check --show-settings Settings path: ".../asc-devkit/ruff.toml" linter.line_length = 88 120 有三层依据: 1. **本仓 C++ 侧已定 120** —— .clang-format: ColumnLimit: 120。同一仓库 C++ 120、Python 88 本身不一致。 2. **CANN 生态其余 Python 仓统一为 120** —— pyasc、pypto、pto-isa、ops-test-kit、vllm-ascend(ruff),torch_npu、pytorch(flake8)。asc-devkit 是其中唯一没配的。 3. **本仓 Python 历史上事实遵守 120** —— ruff-format 落地前,非空行 P99.5 = 119,99.82% 的行 ≤ 120;超 120 的 38 行基本是嵌在 Python 里的 C++ 模板与宏定义。 88 列会把多参数调用强制拆成逐参数一行,一条语句常常变 3-5 行: python # 前(1 行) raise RuntimeError("Length of ASCENDC_TPL_UINT_{} {} is too short.".format(self.macro_type, self.name)) # 后(5 行) raise RuntimeError( "Length of ASCENDC_TPL_UINT_{} {} is too short.".format( self.macro_type, self.name ) ) ### 为什么关 magic trailing comma 末尾逗号会让 ruff-format 强制保持展开,即使该行放得下。统计范围内现存 886 处此类逗号,**绝大多数是 88 列时期 ruff 自己折行时补上的,并非作者意图** ——换到 120 列后这些调用本可收拢,却因那个自动留下的逗号继续保持展开。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [x] 🧹 chore: 代码格式修改 See merge request: cann/asc-devkit!6286 | 13 小时前 | |
修复issue 1409和issue 1472 Co-authored-by: cgcaof<caochenguang1@h-partners.com> # message auto-generated for no-merge-commit merge: !5100 merge master into master 修复issue 1409和issue 1472 Created-by: cgcaof Commit-by: cgcaof Merged-by: cann-robot Description: ## 描述 修复issue 1409,文档链接指向错误 修复issue 1472,链接名称错误 ## 关联的Issue https://gitcode.com/cann/asc-devkit/issues/1409 https://gitcode.com/cann/asc-devkit/issues/1472 ## 测试 不涉及 ## 文档更新 docs/zh/guide/算子实践参考/SIMD算子实现/融合算子编程/CV融合/算子实现.md ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5100 | 1 个月前 | |
修复issue 1409和issue 1472 Co-authored-by: cgcaof<caochenguang1@h-partners.com> # message auto-generated for no-merge-commit merge: !5100 merge master into master 修复issue 1409和issue 1472 Created-by: cgcaof Commit-by: cgcaof Merged-by: cann-robot Description: ## 描述 修复issue 1409,文档链接指向错误 修复issue 1472,链接名称错误 ## 关联的Issue https://gitcode.com/cann/asc-devkit/issues/1409 https://gitcode.com/cann/asc-devkit/issues/1472 ## 测试 不涉及 ## 文档更新 docs/zh/guide/算子实践参考/SIMD算子实现/融合算子编程/CV融合/算子实现.md ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5100 | 1 个月前 | |
修复issue 1409和issue 1472 Co-authored-by: cgcaof<caochenguang1@h-partners.com> # message auto-generated for no-merge-commit merge: !5100 merge master into master 修复issue 1409和issue 1472 Created-by: cgcaof Commit-by: cgcaof Merged-by: cann-robot Description: ## 描述 修复issue 1409,文档链接指向错误 修复issue 1472,链接名称错误 ## 关联的Issue https://gitcode.com/cann/asc-devkit/issues/1409 https://gitcode.com/cann/asc-devkit/issues/1472 ## 测试 不涉及 ## 文档更新 docs/zh/guide/算子实践参考/SIMD算子实现/融合算子编程/CV融合/算子实现.md ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5100 | 1 个月前 | |
修复issue 1409和issue 1472 Co-authored-by: cgcaof<caochenguang1@h-partners.com> # message auto-generated for no-merge-commit merge: !5100 merge master into master 修复issue 1409和issue 1472 Created-by: cgcaof Commit-by: cgcaof Merged-by: cann-robot Description: ## 描述 修复issue 1409,文档链接指向错误 修复issue 1472,链接名称错误 ## 关联的Issue https://gitcode.com/cann/asc-devkit/issues/1409 https://gitcode.com/cann/asc-devkit/issues/1472 ## 测试 不涉及 ## 文档更新 docs/zh/guide/算子实践参考/SIMD算子实现/融合算子编程/CV融合/算子实现.md ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5100 | 1 个月前 | |
style: ruff 配置行宽 120 并关闭 magic trailing comma Co-authored-by: zhangyujia77<zhangyujia37@huawei.com> # message auto-generated for no-merge-commit merge: !6286 merge style/ruff-line-length-120 into master style: ruff 配置行宽 120 并关闭 magic trailing comma Created-by: zhangyujia77 Commit-by: zhangyujia77 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ruff.toml 新增两项配置并据此重排全仓 Python 代码: line-length = 120 行宽从默认 88 放宽到 120 [format] skip-magic-trailing-comma = true 忽略末尾逗号的强制展开语义 ### 为什么改 line-length ruff 的 line-length 此前**从未在仓库任何地方配置过** —— ruff.toml 只设了target-version,全仓搜 line-length 零命中,pre-commit 的 ruff hook 也没传参。 所以生效值 88 是 ruff 内置默认(沿用 Black 的约定),**不是评估过的技术决策**: $ ruff check --show-settings Settings path: ".../asc-devkit/ruff.toml" linter.line_length = 88 120 有三层依据: 1. **本仓 C++ 侧已定 120** —— .clang-format: ColumnLimit: 120。同一仓库 C++ 120、Python 88 本身不一致。 2. **CANN 生态其余 Python 仓统一为 120** —— pyasc、pypto、pto-isa、ops-test-kit、vllm-ascend(ruff),torch_npu、pytorch(flake8)。asc-devkit 是其中唯一没配的。 3. **本仓 Python 历史上事实遵守 120** —— ruff-format 落地前,非空行 P99.5 = 119,99.82% 的行 ≤ 120;超 120 的 38 行基本是嵌在 Python 里的 C++ 模板与宏定义。 88 列会把多参数调用强制拆成逐参数一行,一条语句常常变 3-5 行: python # 前(1 行) raise RuntimeError("Length of ASCENDC_TPL_UINT_{} {} is too short.".format(self.macro_type, self.name)) # 后(5 行) raise RuntimeError( "Length of ASCENDC_TPL_UINT_{} {} is too short.".format( self.macro_type, self.name ) ) ### 为什么关 magic trailing comma 末尾逗号会让 ruff-format 强制保持展开,即使该行放得下。统计范围内现存 886 处此类逗号,**绝大多数是 88 列时期 ruff 自己折行时补上的,并非作者意图** ——换到 120 列后这些调用本可收拢,却因那个自动留下的逗号继续保持展开。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [x] 🧹 chore: 代码格式修改 See merge request: cann/asc-devkit!6286 | 13 小时前 | |
style: ruff 配置行宽 120 并关闭 magic trailing comma Co-authored-by: zhangyujia77<zhangyujia37@huawei.com> # message auto-generated for no-merge-commit merge: !6286 merge style/ruff-line-length-120 into master style: ruff 配置行宽 120 并关闭 magic trailing comma Created-by: zhangyujia77 Commit-by: zhangyujia77 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ruff.toml 新增两项配置并据此重排全仓 Python 代码: line-length = 120 行宽从默认 88 放宽到 120 [format] skip-magic-trailing-comma = true 忽略末尾逗号的强制展开语义 ### 为什么改 line-length ruff 的 line-length 此前**从未在仓库任何地方配置过** —— ruff.toml 只设了target-version,全仓搜 line-length 零命中,pre-commit 的 ruff hook 也没传参。 所以生效值 88 是 ruff 内置默认(沿用 Black 的约定),**不是评估过的技术决策**: $ ruff check --show-settings Settings path: ".../asc-devkit/ruff.toml" linter.line_length = 88 120 有三层依据: 1. **本仓 C++ 侧已定 120** —— .clang-format: ColumnLimit: 120。同一仓库 C++ 120、Python 88 本身不一致。 2. **CANN 生态其余 Python 仓统一为 120** —— pyasc、pypto、pto-isa、ops-test-kit、vllm-ascend(ruff),torch_npu、pytorch(flake8)。asc-devkit 是其中唯一没配的。 3. **本仓 Python 历史上事实遵守 120** —— ruff-format 落地前,非空行 P99.5 = 119,99.82% 的行 ≤ 120;超 120 的 38 行基本是嵌在 Python 里的 C++ 模板与宏定义。 88 列会把多参数调用强制拆成逐参数一行,一条语句常常变 3-5 行: python # 前(1 行) raise RuntimeError("Length of ASCENDC_TPL_UINT_{} {} is too short.".format(self.macro_type, self.name)) # 后(5 行) raise RuntimeError( "Length of ASCENDC_TPL_UINT_{} {} is too short.".format( self.macro_type, self.name ) ) ### 为什么关 magic trailing comma 末尾逗号会让 ruff-format 强制保持展开,即使该行放得下。统计范围内现存 886 处此类逗号,**绝大多数是 88 列时期 ruff 自己折行时补上的,并非作者意图** ——换到 120 列后这些调用本可收拢,却因那个自动留下的逗号继续保持展开。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [x] 🧹 chore: 代码格式修改 See merge request: cann/asc-devkit!6286 | 13 小时前 | |
style: ruff 配置行宽 120 并关闭 magic trailing comma Co-authored-by: zhangyujia77<zhangyujia37@huawei.com> # message auto-generated for no-merge-commit merge: !6286 merge style/ruff-line-length-120 into master style: ruff 配置行宽 120 并关闭 magic trailing comma Created-by: zhangyujia77 Commit-by: zhangyujia77 Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ruff.toml 新增两项配置并据此重排全仓 Python 代码: line-length = 120 行宽从默认 88 放宽到 120 [format] skip-magic-trailing-comma = true 忽略末尾逗号的强制展开语义 ### 为什么改 line-length ruff 的 line-length 此前**从未在仓库任何地方配置过** —— ruff.toml 只设了target-version,全仓搜 line-length 零命中,pre-commit 的 ruff hook 也没传参。 所以生效值 88 是 ruff 内置默认(沿用 Black 的约定),**不是评估过的技术决策**: $ ruff check --show-settings Settings path: ".../asc-devkit/ruff.toml" linter.line_length = 88 120 有三层依据: 1. **本仓 C++ 侧已定 120** —— .clang-format: ColumnLimit: 120。同一仓库 C++ 120、Python 88 本身不一致。 2. **CANN 生态其余 Python 仓统一为 120** —— pyasc、pypto、pto-isa、ops-test-kit、vllm-ascend(ruff),torch_npu、pytorch(flake8)。asc-devkit 是其中唯一没配的。 3. **本仓 Python 历史上事实遵守 120** —— ruff-format 落地前,非空行 P99.5 = 119,99.82% 的行 ≤ 120;超 120 的 38 行基本是嵌在 Python 里的 C++ 模板与宏定义。 88 列会把多参数调用强制拆成逐参数一行,一条语句常常变 3-5 行: python # 前(1 行) raise RuntimeError("Length of ASCENDC_TPL_UINT_{} {} is too short.".format(self.macro_type, self.name)) # 后(5 行) raise RuntimeError( "Length of ASCENDC_TPL_UINT_{} {} is too short.".format( self.macro_type, self.name ) ) ### 为什么关 magic trailing comma 末尾逗号会让 ruff-format 强制保持展开,即使该行放得下。统计范围内现存 886 处此类逗号,**绝大多数是 88 列时期 ruff 自己折行时补上的,并非作者意图** ——换到 120 列后这些调用本可收拢,却因那个自动留下的逗号继续保持展开。 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #xxx--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [x] 🧹 chore: 代码格式修改 See merge request: cann/asc-devkit!6286 | 13 小时前 | |
修复issue 1409和issue 1472 Co-authored-by: cgcaof<caochenguang1@h-partners.com> # message auto-generated for no-merge-commit merge: !5100 merge master into master 修复issue 1409和issue 1472 Created-by: cgcaof Commit-by: cgcaof Merged-by: cann-robot Description: ## 描述 修复issue 1409,文档链接指向错误 修复issue 1472,链接名称错误 ## 关联的Issue https://gitcode.com/cann/asc-devkit/issues/1409 https://gitcode.com/cann/asc-devkit/issues/1472 ## 测试 不涉及 ## 文档更新 docs/zh/guide/算子实践参考/SIMD算子实现/融合算子编程/CV融合/算子实现.md ## 类型标签 <!-- [x] 表示选中 --> - [x] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [ ] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!5100 | 1 个月前 | |
【样例】更新01_simd_cpp_api下样例目录结构 Co-authored-by: wx369<wangxu243@huawei.com> # message auto-generated for no-merge-commit merge: !3131 merge master into master 【样例】更新01_simd_cpp_api下样例目录结构 Created-by: wx369 Commit-by: wx369 Merged-by: cann-robot Description: ## 描述 更新01_simd_cpp_api下样例目录结构 ## 关联的Issue 关联Issue [#896](https://gitcode.com/cann/asc-devkit/issues/896) ## 测试 通过了样例的编译运行 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!3131 | 3 个月前 | |
【样例】更新01_simd_cpp_api下样例目录结构 Co-authored-by: wx369<wangxu243@huawei.com> # message auto-generated for no-merge-commit merge: !3131 merge master into master 【样例】更新01_simd_cpp_api下样例目录结构 Created-by: wx369 Commit-by: wx369 Merged-by: cann-robot Description: ## 描述 更新01_simd_cpp_api下样例目录结构 ## 关联的Issue 关联Issue [#896](https://gitcode.com/cann/asc-devkit/issues/896) ## 测试 通过了样例的编译运行 ## 文档更新 NA ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 fix: Bug 修复 - [ ] ✨ feat: 新功能 - [ ] ⚡ perf: 性能优化 - [x] ♻️ refactor: 代码重构 - [ ] 🧪 test: 新增或修改测试 - [ ] 📝 docs: 文档更新 - [ ] 🔧 ci: CI/CD 配置修改 - [ ] ↩️ revert: 回退 - [ ] 🧹 chore: 其他,请具体描述 See merge request: cann/asc-devkit!3131 | 3 个月前 |
Libraries样例介绍
概述
基于Ascend C高阶API的使用样例,通过<<<>>>直调的实现方式,介绍了高阶API的使用方法。
样例列表
| 目录名称 | 功能描述 |
|---|---|
| 00_matmul | 本样例集介绍了Matmul API不同特性的典型用法,给出了对应的端到端实现 |
| 01_activation | 本样例集介绍了激活函数在算子不同特性的典型用法,给出了对应的端到端实现 |
| 02_normalization | 本样例集介绍了归一化操作不同特性的典型用法,给出了对应的端到端实现 |
| 03_quantization | 本样例集介绍了量化操作算子不同特性的典型用法,给出了对应的端到端实现 |
| 04_reduce | 本样例集介绍了归约操作算子不同特性的典型用法,给出了对应的端到端实现 |
| 05_sort | 本样例集介绍了排序操作算子不同特性的典型用法,给出了对应的端到端实现 |
| 06_index | 本样例集介绍了索引计算算子不同特性的典型用法,给出了对应的端到端实现 |
| 07_filter | 本样例集介绍了数据过滤算子不同特性的典型用法,给出了对应的端到端实现 |
| 08_transpose | 本样例集介绍了张量变换算子不同特性的典型用法,给出了对应的端到端实现 |
| 09_random | 本样例集介绍了随机函数不同特性的典型用法,给出了对应的端到端实现 |
| 10_math | 本样例集介绍了数学计算在算子中不同特性的典型用法,给出了对应的端到端实现 |
| 11_utils | 本样例集介绍了数据类型特性的典型用法,给出了对应的端到端实现 |