| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[master][bugfix]cann and pta header mixing bulid bugfix | 23 天前 | |
feat: support torch cond in NPUGraph Co-authored-by: ChengLyric<licheng236@huawei.com> # message auto-generated for no-merge-commit merge: !38409 merge npugraph-cond-master into master feat: support torch cond in NPUGraph Created-by: Guanam2020 Commit-by: ChengLyric Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 新增 torch.cond 在 NPUGraph 中的支持能力,使条件分支可以在 graph capture 阶段被捕获为 ACL 条件节点,并在 replay 阶段根据 NPU 上的 bool scalar predicate 选择对应分支执行。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 新增 test/npu/test_aclgraph_conditional_nodes.py。 覆盖 true/false 分支分别执行正确性。 覆盖 graph capture 后多次 replay,predicate 改变时分支选择正确。 覆盖 functionalized torch.cond 场景。 覆盖非法 predicate 输入的报错路径,例如非 NPU tensor、非 scalar tensor、非 bool tensor、跨 device tensor。 确认不依赖本地 ACL stub 打桩,使用正式 ACL 条件节点接口。 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38409 | 3 个月前 | |
support irq bind Co-authored-by: zhaoyu65<nanzhaogang@qq.com> # message auto-generated for no-merge-commit merge: !39977 merge master-IRQ into master support irq bind Created-by: zhaoyu65 Commit-by: zhaoyu65 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 [#2139](https://gitcode.com/Ascend/pytorch/issues/2139) # 【修改方案】 1、在环境变量CPU_AFFINITY_CONF中新增选项bind_irq; 2、对指定NPU的irq中断绑核,独占2个CPU核 # 【资料变更】 后续在2.7.1分支合入资料 # 【接口变更】 环境变量CPU_AFFINITY_CONF中新增选项bind_irq; # 【功能验证】 验证OK # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!39977 | 2 个月前 | |
[feature]torch_npu support dlpack Co-authored-by: zhang_xu_hao1230<zhangxuhao6@huawei.com> # message auto-generated for no-merge-commit merge: !26141 merge master_dlpack into master [feature]torch_npu support dlpack Created-by: zhang_xu_hao1230 Commit-by: zhang_xu_hao1230 Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** /kind feature **What does this PR do / why do we need it**: torch_npu支持dlpack 通过用torch_npu下from_blob替换torch下的from_blob实现dlpack支持 todo:等待from_blob支持310上的NZ format **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage: Fixes #<issue number>, or Fixes (paste link of issue). --> Fixes # **Special notes for your reviewers**: See merge request: Ascend/pytorch!26141 | 10 个月前 | |
fix: update DVM r2.10 submodule Co-authored-by: huangchengnuo<huangchengnuo1@huawei.com> # message auto-generated for no-merge-commit merge: !44748 merge update-dvm-r210-spec-fallback-master into master fix: update DVM r2.10 submodule Created-by: SorryNaCN Commit-by: huangchengnuo Merged-by: ascend-robot Description: # 【合入来源】 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 Fixes https://gitcode.com/Ascend/pytorch/issues/4124 # 【修改方案】 1. 将当前 PyTorch master 分支的 third_party/dvm/dvm gitlink 从 b64eba7c8abe501cd216f94feddfe12b5c6e2192 更新到 DVM r2.10 当前提交 6e86795f3ce6832c72e7558454d7bb0864d2688e。 2. DVM !771 修复 SpecVector::FallCodeGen() 在跳过未使用 load 后 clone 索引错位的问题,避免后续 Reduce clone 读取非法指针并在 codegen 阶段触发段错误。 3. DVM !774 基于 CANN 9.1.0-beta.3 重新生成 r2.10 prebuild,使更新后的 CCE 编译指令进入预编译产物。 4. DVM 上游提交均已合入: - [mindspore/dvm !771](https://gitcode.com/mindspore/dvm/merge_requests/771) - [mindspore/dvm !774](https://gitcode.com/mindspore/dvm/merge_requests/774) # 【资料变更】 不涉及。 # 【接口变更】 不涉及。 # 【功能验证】 - DVM r2.10 修复前,纯 DVM 回归用例在 Tester.codegen() 触发 SIGSEGV,pytest 退出码为 139;修复后 test_spec_vector.py + test_clone.py 共 40 passed。 - 使用 CANN 9.1.0-beta.3 重新生成 C220/C310 prebuild,make PRE_ASCEND=1 -j8 构建通过;910B3 单卡回归 test_spec_fall_clone_after_unused_load 结果为 1 passed。 - PyTorch 侧仅更新 third_party/dvm/dvm gitlink;相对目标分支为 1 个提交、1 个文件,git diff --check 通过。 # 【CheckList】 - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44748 | 30 天前 | |
[master][bugfix]cann and pta header mixing bulid bugfix | 23 天前 | |
feat(profiler): mspti backend for torch.profiler PrivateUse1 Co-authored-by: Dmitry Gladkov<gladkov.dmitry1@huawei.com> # message auto-generated for no-merge-commit merge: !44554 merge feat/mspti-kineto-backend into master feat(profiler): mspti backend for torch.profiler PrivateUse1 Created-by: gladkov_dmitry Commit-by: Dmitry Gladkov Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [x] Requirement / Feature - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【Modification Scheme】 torch.profiler on Ascend collected CPU activity only. Nothing supplied device data for ProfilerActivity.PrivateUse1, so the NPU half of the timeline was empty and users had to reach for a second, incompatible profiler to see what the device did. This adds a libkineto plugin backed by mspti. NPU kernels now appear in a standard torch.profiler trace next to CPU operations, on one timeline. > PyTorch and libkineto are unchanged. The plugin registers itself through REGISTER_PRIVATEUSE1_PROFILER and is driven by libkineto through IActivityProfilerSession. > This is not torch_npu.profiler. That is a separate implementation over acl_prof with its own enums and configuration class; the two are independent front ends and can be used side by side. Files: > torch_npu/csrc/profiler/mspti_activity_profiler.{h,cpp}: the session - lifecycle, record conversion, device and stream lanes, flow emission. > torch_npu/csrc/framework/interface/MsptiInterface.{h,cpp}: wrappers over libmspti. Every symbol is resolved at runtime through FunctionLoader, so a missing or older libmspti.so gives an empty device lane rather than a link failure. > torch_npu/_init/registry/backend.py, CMakeLists.txt: registration and build. Kernels are linked back to the operations that launched them. A global RecordFunction callback pushes each operation's handle as an mspti external correlation id; mspti ties that handle to the correlation id of the launch call, which the kernel shares. processTrace turns the join into ac2g flows - the arrows a viewer draws from a CPU operation to the kernel it produced. > About three quarters of kernels link. The rest are launched outside any operation scope - allocator work, autograd internals, runtime housekeeping - and have nothing to point back to. The proportion is stable as the workload grows. > The flow tail is a PRIVATEUSE1_RUNTIME marker on the host process, mirroring CUDA where flows start on a cuda_runtime event rather than on a cpu_op. Two presentation decisions worth knowing when reading a trace: > Device operators export without an mspti:: prefix, so they read the way CUDA kernels do in a torch.profiler trace. > The NPU process takes a sort index above any real pid, so its lane renders below the CPU lane. Correlation ids on exported activities come from a private counter rather than from mspti: mspti's ids are not unique per event and collide with torch's low cpu-side ids, which would fail upstream's uniqueness check. stop() drains until records stop arriving rather than until a fixed deadline. mspti delivers asynchronously, roughly 200 ms behind execution, so a time cap truncated the tail of a recording. The loop now exits once several consecutive flushes add nothing, which captures more and returns in about 150 ms. # 【Documentation Change】 > Not involved. Behaviour and limitations are described in the module header. # 【Interface Change】 > No API signature change. Customer-visible: profiling with activities=[ProfilerActivity.CPU, ProfilerActivity.PrivateUse1] now yields NPU device kernels in the trace and in events() / key_averages(), where previously the device side was empty. Existing CPU-only behaviour is unchanged. # 【Functional Verification】 bash cd /tmp && python test/profiler/test_mspti_backend.py > 12 tests in three classes on Ascend 910B4, CANN 9.1.0, torch 2.13.0+cpu. > TestMsptiBackend: kernels reach the trace, carry type and streamId, export without the mspti:: prefix, the NPU lane sorts below the CPU lane, and every cycle of a schedule() run collects - so the backend re-arms between cycles. > TestMsptiAc2g: flows are emitted as start and finish pairs, every start has a finish, one start per operation, none points backwards in time, the ids match operations recorded by torch, the two ends land on different lanes, and the whole trace fits one timeline. > Kernel counts are never asserted in the tests: mspti delivers records asynchronously, so counts vary between runs. The assertions are structural. Trace view. Collected from bare tensor operations rather than a model, so the device lane holds a predictable set of kernels: python a = torch.randn(4096, 4096, device="npu") b = torch.randn(4096, 4096, device="npu") def phases(): with record_function("matmul"): for _ in range(5): torch.matmul(a, b) with record_function("add"): for _ in range(5): torch.add(a, b) with record_function("sum"): for _ in range(5): torch.sum(a) phases() # warm up outside profiling torch.npu.synchronize() with profile(activities=[ProfilerActivity.CPU, ProfilerActivity.PrivateUse1]) as prof: phases() torch.npu.synchronize() prof.export_chrome_trace("trace.json") Fifteen operations issued, <N> device kernels collected. 4096x4096 keeps each kernel millisecond-scale and visible. Opened at ui.perfetto.dev.  > The NPU lane sits below the CPU lane with its kernels named, against the matmul, add and sum phases above, and an ac2g arrow runs from the operation to the kernel it launched. > The flow tail is placed at the kernel's timestamp rather than the host launch time: the host clock reachable from this path has a different base. The link itself is exact; only the arrow's visual origin is approximate. > On CANN versions: only 9.1.0 is installed on the verification machine, so this was not built against an earlier CANN. The mspti dependency is resolved at runtime through FunctionLoader rather than linked, so a CANN without libmspti.so gives an empty device lane rather than a build or load failure. The kineto include added to CMakeLists.txt points at PyTorch's bundled headers, not CANN's, so it carries no CANN version dependency. # 【CheckList】 - [x] Comments complete - [x] Return-value / null-pointer checks done - [x] PR title uses type label (feat) - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!44554 | 1 个月前 | |
| 1 年前 | ||
[feat]support shmemput/get Co-authored-by: pengqi<pengqi33@huawei.com> # message auto-generated for no-merge-commit merge: !36241 merge master_symm into master [feat]support shmemput/get Created-by: pengqihw Commit-by: pengqihw;pengqi Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1.SHMEM put/get 功能支持(对齐上游 NVSHMEM 后端实现方式) - NPUSHMEMInterface.h :Shmem_putmem_on_stream / Shmem_getmem_on_stream 声明 - NPUSHMEMInterface.cpp : aclshmemx_putmem_on_stream / aclshmemx_getmem_on_stream 动态加载 - NPUSHMEMExtension.cpp : nvshmem_put / nvshmem_get 接口实现和注册,使用 on_stream 接口并传入 c10_npu::getCurrentNPUStream() - shmem_host_def.h:同步shmem库的结构体更新 - test_shmem.py: get/put测试用例 2. 线程安全保护(同步上游 commit 4ae3a4e) - NPUSHMEMSymmetricMemory.hpp :添加 #include <mutex> , NPUSHMEMSymmetricMemoryAllocator 新增 std::mutex mutex_ - NPUSHMEMSymmetricMemory.cpp : alloc() 、 free() 、 get_alloc_size() 、 rendezvous() 四个方法中对 allocations_ 和 symm_mems_ 的访问加 std::lock_guard<std::mutex> 保护 # 【资料变更】 不涉及 # 【接口变更】 不涉及 PyTorch 上游已提供了对称内存的抽象框架,并定义了 nvshmem_put / nvshmem_get 算子接口。 # 【功能验证】  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36241 | 3 个月前 | |
Update torchair commit id Co-authored-by: pta-robot<pta_robot@163.com> # message auto-generated for no-merge-commit merge: !44826 merge master into master Update torchair commit id Created-by: pta-robot Commit-by: pta-robot Merged-by: ascend-robot Description: Commited by @pta-robot at 2026-08-18 18:02:45. See merge request: Ascend/pytorch!44826 | 1 个月前 | |
[feat]suppport ninja Co-authored-by: LiNuohang<linuohang@huawei.com> # message auto-generated for no-merge-commit merge: !34127 merge ninja into master [feat]suppport ninja Created-by: LiNuohang Commit-by: LiNuohang Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 当环境支持ninja时,优先使用ninja # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!34127 | 4 个月前 | |
| 1 年前 | ||
Redirect Googletest to v1.12.x. | 3 年前 | |
| 1 年前 | ||
Update op_plugin commit id Co-authored-by: pta-robot<pta_robot@163.com> # message auto-generated for no-merge-commit merge: !44916 merge master into master Update op_plugin commit id Created-by: pta-robot Commit-by: pta-robot Merged-by: ascend-robot Description: Commited by @pta-robot at 2026-08-19 18:02:35. See merge request: Ascend/pytorch!44916 | 30 天前 | |
add submodule torch mlir Co-authored-by: lijintao<lijintao14@huawei.com> # message auto-generated for no-merge-commit merge: !25896 merge 11-add-submodule-torch-mlir into master add submodule torch mlir Created-by: gent1e Commit-by: lijintao Merged-by: ascend-robot Description: <!-- Thanks for sending a pull request! --> **What type of PR is this?** > Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line: > > /kind bug > /kind task > /kind feature **What does this PR do / why do we need it**: **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage: Fixes #<issue number>, or Fixes (paste link of issue). --> Fixes # **Special notes for your reviewers**: See merge request: Ascend/pytorch!25896 | 10 个月前 |