| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
解决编译warning打屏以及编译运行时出现的错误 Co-authored-by: wwwlyy<wangxiaohan40@h-partners.com> # message auto-generated for no-merge-commit merge: !4 merge warning into master 解决编译warning打屏以及编译运行时出现的错误 Created-by: gcw_CfilvwB1 Commit-by: wwwlyy Merged-by: cann-robot Description: ## 变更描述 / Description <!-- 本 PR 做了什么,为什么需要 / What does this PR do and why --> 1.修复了编译时出现的warning 2.修复了编译运行时出现的错误 ## 改动类型 / Change Type - [x] Bug 修复 / Bug Fix - [ ] 新功能 / New Feature - [ ] 性能优化 / Performance - [ ] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 关联 Issue / Related Issues <!-- Closes #000 可自动关闭 / Closes #000 to auto-close --> - Closes [#2](https://gitcode.com/cann/ops-gnn/issues/2) - References [#2](https://gitcode.com/cann/ops-gnn/issues/2) ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [x] 单元测试通过 / UT passed - [x] 集成测试通过 / ST passed - [x] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [x] 代码符合规范 / Code follows style guide - [ ] 测试添加并通过 / Tests added and passed - [ ] 文档已更新 / Docs updated if needed - [ ] 无硬编码敏感信息 / No secrets hardcoded - [x] 提交信息符合规范 / Commit message follows convention ## 修改内容 ### Python 打包警告修复 | 警告 | 次数 | 根因 | 修复方法 | 修改文件 | |------|------|------|----------|----------| | License classifiers are deprecated | 2 | classifiers 含 License :: OSI Approved :: MIT License | 删除该 classifier | pyproject.toml、setup.cfg | | project.license as a TOML table is deprecated | 2 | license = {text = "MIT"} TOML 表格式 | 改为 dynamic = ["license"],setup.py 中声明 license='MIT' | pyproject.toml、setup.py | | extras_require overwritten in pyproject.toml | 2 | setup.py 与 pyproject.toml 重复配置 | setup.py 删除 extras_require | setup.py | | setup.py install is deprecated | 1 | build.sh 调用 setup.py bdist_wheel | 改为 python -m pip wheel . --no-deps --no-build-isolation | scripts/build.sh | | wheel bdist_wheel FutureWarning | 2 | 自定义 CustomBDistWheel 类继承 vendored wheel | 删除 CustomBDistWheel 类,统一用 pip wheel | setup.py | | no files found matching '*.cu' | 1 | MANIFEST.in 引用不存在的 *.cu | 删除 *.cu,保留 *.h *.cpp | MANIFEST.in | ### CANN/Kernel 编译警告修复 | 警告 | 次数 | 根因 | 修复方法 | 修改文件 | |------|------|------|----------|----------| | kineto_LIBRARY-NOTFOUND CMake Warning | 2 | PyTorch CPU 版不含 CUDA profiling 库 libkineto.a,TorchConfig.cmake 中 find_library 查找不到输出 message(WARNING)。该库仅用于 CUDA 性能分析,NPU 平台不需要 | find_package(Torch) 前将 kineto_LIBRARY cache 变量预置为已存在的 libtorch.so,find_library 发现 cache 已有值则跳过搜索,不再输出 warning。libtorch.so 本就参与最终链接,不会引入新依赖 | CMakeLists.txt | | kernel type is not marked | 8 | segment_max_csr_kernel 未标记 aiv 属性 | kernel 函数添加 __attribute__((aiv)) | csrc/npu/kernel/segment_max_csr/segment_max_csr_kernel_impl.h | | cce_global attribute ignored [-Wignored-attributes] | 4 | bisheng 编译器对 GM_ADDR 强转报 warning | kernel 启动行用 #pragma GCC diagnostic push/pop 精确抑制(CANN 工具链已知行为,C-style 强转是 kernel 启动的必要写法) | csrc/npu/kernel/segment_max_csr/segment_max_csr_kernel.cpp | ### build.sh 错误处理改进 | 问题 | 修复方法 | 修改文件 | |------|----------|----------| | usage() 固定 exit 0,只显示命令错误,无完整帮助信息 | 改为 exit "${1:-0}" 支持自定义退出码 | scripts/build.sh | | Python 版本检测不传递给 CMake | 添加 Python3_ROOT_DIR 环境变量导出 | scripts/build.sh | | --clean 对 python 目标无效(CMakeCache.txt 缓存旧 Python 版本) | clean_build 移到 main 函数统一调用,删除 build_cpp 里的重复调用 | scripts/build.sh | | pip wheel -w output/whl 可能将 output/whl 创建为文件而非目录 | pip wheel 前加 mkdir -p output/whl | scripts/build.sh | ### CMakeLists.txt 改进 | 改进点 | 说明 | |--------|------| | 添加版权头注释 | 补充 CANN OSL 协议头 | | Python3 查找逻辑优化 | 优先用 Python3_ROOT_DIR 环境变量,避免找到错误版本 | | 抑制 kineto 警告 | find_package(Torch) 前将 kineto_LIBRARY 预置为已存在的 libtorch.so,利用 CMake find_library 在 cache 已有值时跳过搜索的机制消除 warning,libtorch.so 本就参与链接不引入额外依赖 | ### NPU 算子测试修复 | 问题 | 修复方法 | 修改文件 | |------|----------|----------| | add_sample 使用 torch::zeros_like 触发 tensor format 警告 | 改为 torch::empty_like(src1.cpu()).to(src1.device()) | csrc/npu/host/add_sample/add_sample.cpp | | test_add_sample_npu 直接创建 NPU tensor 失败 | 改为 CPU 创建后 .npu() 转移 | test/test_example.py | | uint8 张量在 NPU 上计算 expected 失败 | 改为 CPU 上计算后比较 | test/test_example.py | ### 环境要求更新 CANN 9.x + Ascend950 需要 PyTorch 2.7+ 及 v26.0.0 发布线的 torch_npu。 ## 测试验证 - ./scripts/build.sh python 正常构建,无任何警告 - ./scripts/build.sh --clean 清理缓存后构建,CMakeCache.txt 不再缓存旧 Python 版本 - ./scripts/build.sh 123 打印错误+完整帮助,退出码 1 - ./scripts/build.sh --help 显示帮助,退出码 0 - python3 -m pytest test/ -v 全部 13 个测试通过 - 兼容 Python 3.9+(setuptools>=61,CMake 3.15+) - 已在 Python 3.9.25 、Python 3.11.15 、Python3.12.13 验证通过 See merge request: cann/ops-gnn!4 | 20 天前 | |
添加segment_max_csr算子并优化基础框架 Co-authored-by: goodpeople233<guojiong1@huawei.com> # message auto-generated for no-merge-commit merge: !2 merge master into master 添加segment_max_csr算子并优化基础框架 Created-by: goodpeople233 Commit-by: goodpeople233 Merged-by: cann-robot Description: ## 变更描述 / Description 添加segment_max_csr算子,同时调整了目录划分,优化了编译逻辑。 ## 改动类型 / Change Type - [ ] Bug 修复 / Bug Fix - [x] 新功能 / New Feature - [ ] 性能优化 / Performance - [x] 代码重构 / Refactoring - [ ] 文档更新 / Documentation - [ ] 测试相关 / Test - [ ] 其它 / Other ## 关联 Issue / Related Issues <!-- Closes #000 可自动关闭 / Closes #000 to auto-close --> - Closes [#1](https://gitcode.com/cann/ops-gnn/issues/1) ## 测试信息 / Testing <!-- 简要测试说明或关键结果 / Brief test description or key results --> - [x] 单元测试通过 / UT passed - [ ] 集成测试通过 / ST passed - [ ] 人工验证通过 / Manual verified ## 检查清单 / Checklist - [x] 代码符合规范 / Code follows style guide - [x] 测试添加并通过 / Tests added and passed - [x] 文档已更新 / Docs updated if needed - [x] 无硬编码敏感信息 / No secrets hardcoded - [x] 提交信息符合规范 / Commit message follows convention See merge request: cann/ops-gnn!2 | 26 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 20 天前 | ||
| 26 天前 |