文件最后提交记录最后更新时间
!22795 Skip test_aclrtSetDevice on 910A because it is slow Merge pull request !22795 from yuhaiyan/master-dev1 10 个月前
[fix] support memory reuse in launch_host_func_pending Co-authored-by: Chukun Wang<wangchukun@huawei.com> # message auto-generated for no-merge-commit merge: !36074 merge master into master [fix] support memory reuse in launch_host_func_pending Created-by: kita-ikuyo Commit-by: Chukun Wang Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> https://gitcode.com/Ascend/pytorch/issues/2009 - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) launch_host_func_pending由直接传递Tensor改为传递tensor地址,由callback thread根据地址做h2h拷贝,拷贝结束后原始tensor的pinned memory可以被释放并复用。回调线程/python线程使用被拷贝的tensor值做后续print/save,并在print/save结束后释放内存,以节省运行时host内存使用。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 验证ok,修改前整网出现host oom,修改后解决。 ![2.jpg](https://raw.gitcode.com/user-images/assets/7404318/0de6a8bb-47bd-4f6c-8c33-869dd98c6df9/2.jpg '2.jpg') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3607413 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
fix: fix task queue aclgraph bug Co-authored-by: luochao60<luochao60@huawei.com> # message auto-generated for no-merge-commit merge: !32803 merge Pynative_fix_task_queue_aclgraph_bug_add_wait_stream_status_20260327_master into master fix: fix task queue aclgraph bug Created-by: luochao60 Commit-by: luochao60 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > (如有)请关联需求文档/issue链接 - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列 > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 1. **NPUCachingAllocator.h/cpp**:新增 hasCapturesUnderway(device) 接口,用于查询当前设备是否有正在进行的 ACLGraph capture。在 DeviceCachingAllocator 中加锁读取 captures_underway 容器是否为空;在 NpuCachingAllocator 顶层类中实现 override 并转发到对应 device allocator;在头文件中新增 inline 辅助函数 hasCapturesUnderway(device) 供外部调用。 2. **NPUEvent.cpp**:在 NPUEvent::block() 函数中,LaunchWaitEventTask 之后增加判断:若当前设备处于 ACLGraph capture 状态(hasCapturesUnderway 返回 true),则调用 emptyAllNPUStream() 刷新 task queue。修复了多流场景下(主流与旁路流通过 wait_stream 交互时)capture replay 结果不正确的问题。 3. **test/npu/test_aclgraph_multi_stream.py**:新增多流 ACLGraph 正确性测试,覆盖两种场景:shared-expert 旁路流 fork/join 模式、并行分支 fork/join 模式,验证 replay 后数值结果与 eager 模式一致。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写"不涉及" 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写"不涉及" 新增内部接口 NPUCachingAllocator::hasCapturesUnderway(c10::DeviceIndex device),为 NPU allocator 虚函数扩展,不属于对外客户面 API,不涉及跨仓接口变更。 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤 > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 新增测试文件 test/npu/test_aclgraph_multi_stream.py,包含以下用例: - test_shared_expert_stream_capture_replay:验证 shared-expert 旁路流模式下 capture/replay 数值正确性 - test_parallel_branch_capture_replay:验证并行分支 fork-join 模式下 capture/replay 数值正确性 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!328031 个月前
feat: [ACLGRAPH]support pin memory Co-authored-by: luochao60<luochao60@huawei.com> # message auto-generated for no-merge-commit merge: !34382 merge pta_add_pin_memory_pool_20260408_master into master feat: [ACLGRAPH]support pin memory Created-by: luochao60 Commit-by: luochao60 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > (如有)请关联需求文档/issue链接 - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列 > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 本次改动让 ACLGraph 捕获期间也能正常使用 pin_memory(pinned host memory),将 host allocator 接入 NPUGraph 的 mempool 私有池机制,避免 capture 期间申请到的 pinned 内存被错误回收。 1. torch_npu/csrc/core/npu/CachingHostAllocator.cpp: - NPUCachingHostAllocatorImpl 实现基类 CachingHostAllocatorget_current_stream()stream_is_capturing() 虚接口:返回当前 NPU stream,并通过 AclmdlRICaptureGetInfo 判断该 stream 是否处于 capture 状态,使基类能正确识别 NPU 的 capture 语义。 - NPUCachingHostAllocator 重写 begin_allocate_to_pool / end_allocate_to_pool / release_pool 接口,转发到内部 impl,与设备侧 NPUCachingAllocator 的私有池接口一一对应。 2. torch_npu/csrc/core/npu/NPUGraph.cpp: - capture_begin 增加约束:当 pin_memory_expandable_segments=True 时禁止开启 ACLGraph capture。原因是 NPUExpandableHostAllocatorImpl 重写了 allocate/free/empty_cache/record_event,不与基类 CachingHostAllocator 的私有池机制对接,会导致 capture 期间分配的 pinned block 在回放时被错误回收,引发数据损坏;通过 TORCH_CHECK 显式报错,提示用户调整 PYTORCH_NPU_ALLOC_CONF。 - 在调用 NPUCachingAllocator::beginAllocateToPool 之外,同步调用 host allocator 的 begin_allocate_to_pool,将 host pinned 内存也注册到同一个 mempool_id_ 私有池中;filter 通过 NPUStream::stream(false) 取出底层 aclrtStream 后复用同一份判断逻辑,避免触发 PTA 任务队列的 flush。 - capture_end / reset 配套调用 host allocator 的 end_allocate_to_pool / release_pool,与设备侧池的生命周期保持一致。 3. torch_npu/npu/graphs.pygraph 上下文管理器进入时,在 torch.npu.empty_cache() 之后追加一次 torch_npu.npu.host_empty_cache(),避免上一次 capture 残留的 pinned cache 影响本次 capture 的内存可见性。 4. test/npu/test_aclgraph_pin_memory.py:新增 ACLGraph + pin_memory 集成测试用例,覆盖 capture/replay 期间 pin_memory 申请/释放的正确性,以及 pin_memory_expandable_segments=True 与 capture 互斥时的报错路径。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写"不涉及" 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写"不涉及" 不涉及对外公开接口的变更。新增的 get_current_stream / stream_is_capturing / begin_allocate_to_pool / end_allocate_to_pool / release_pool 都是 PTA 内部 host allocator 对 PyTorch 基类 CachingHostAllocator 的虚函数实现/重写,不会改变面向用户的 Python API 行为。 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤 > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 新增 test/npu/test_aclgraph_pin_memory.py 用例,覆盖以下场景: - ACLGraph capture 期间申请 pin_memory tensor,capture 结束后 replay,结果与 eager 一致。 - 多次 capture/replay,pinned 内存释放后能被同一私有池复用,无内存泄漏。 - pin_memory_expandable_segments=True 时调用 capture_begin 应触发 TORCH_CHECK 报错,提示用户调整 PYTORCH_NPU_ALLOC_CONF。 - 通过 python test/npu/test_aclgraph_pin_memory.py 在本地 NPU 环境运行通过。 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3438227 天前
Supports RNG state operations that are safe to call during graph capture Co-authored-by: zzhongmin<zhongmin23@huawei.com> # message auto-generated for no-merge-commit merge: !36737 merge master_st into master Supports RNG state operations that are safe to call during graph capture Created-by: zzhongmin Commit-by: zzhongmin Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 支持 graph capture 期间可安全调用的 NPU RNG state 操作 修复 C++ Generator 层图内 offset 类型与 replay 安全性问题(NPUGeneratorImpl.h + NPUGeneratorImpl.cpp) - offset_intragraph_PhiloxNpuState 的图内 offset 从 uint32_t 升级为 uint64_t,避免大图 capture/replay 时 RNG offset 溢出,并与 CUDA 侧对齐 - register_graph() 增加 InferenceMode guard(false),确保 inference_mode() 下创建的状态 tensor 仍可在 replay 前被原地更新 测试覆盖: - test_get_set_rng_state_during_capture:验证 get_rng_state/set_rng_state 在图捕获中可用,且重放结果与 eager 执行位级一致 - test_set_rng_state_with_nonzero_offset_during_capture:验证在非零偏移量处恢复 RNG 状态同样正确 - test_graph_set_rng_state_seed_mismatch_raises:验证捕获期间 set_rng_state 传入不同 seed 时抛出 RuntimeError - test_graph_checkpoint_preserve_rng_state:验证 checkpoint(preserve_rng_state=True) 在图捕获中可用,梯度与 eager 模式位级一致 - test_graph_manual_seed_mismatch_raises:验证捕获期间 manual_seed 设置不同 seed 时抛出 RuntimeError - test_register_generator_state_under_inference_mode:验证 register_generator_state 在 inference_mode 下可用,且使用独立Generator 的重放结果与 eager 位级一致 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 测试用例 # 【CheckList】 - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!367377 天前
【feat】新增第三批sk_options并更新autofusion commit id Co-authored-by: wangkai<wangkai579@huawei.com> # message auto-generated for no-merge-commit merge: !36330 merge master_sk2 into master 【feat】新增第三批sk_options并更新autofusion commit id Created-by: mihudan Commit-by: wangkai Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 issue链接: https://gitcode.com/Ascend/pytorch/issues/2004 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 ![image.png](https://raw.gitcode.com/user-images/assets/7404318/95f37c76-22e7-4b4c-a017-25a880d10392/image.png 'image.png') 已增加测试用例,出包 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!363308 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
[bugfix][master]fix aclgraph testcase Co-authored-by: y30062407<handsome0324@163.com> # message auto-generated for no-merge-commit merge: !36473 merge master_wtd into master [bugfix][master]fix aclgraph testcase Created-by: yangch0324 Commit-by: y30062407 Merged-by: ascend-robot Description: # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [x] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列 **问题根因:** test_npu_fused_infer_attention_score_v2 测试用例中,softmax_lse 输出张量的预分配 shape 与算子实际输出 shape 不匹配。 具体而言: - 测试代码中 softmax_lse 被硬编码分配为 torch.empty(1, dtype=torch.float16, device="npu"),shape 为 (1,) - 但 npu_fused_infer_attention_score_v2return_softmax_lse=False 时,算子实际返回的 softmax_lse shape 为 (0,)(空张量,因为不需要计算 softmax LSE) - 执行 self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) 时,assertEqual 先比较 shape,发现 torch.Size([1]) != torch.Size([0]),导致断言失败 **对比 v1 的正确做法:** v1 测试(如 test_ifa_update)使用 torch.empty_like(res_src[1], dtype=torch.float16, device="npu") 来分配 softmax_lse,自动匹配 res_src[1] 的实际 shape,不存在此问题。 **修改内容:** 将 v2 相关测试中所有硬编码的 torch.empty(1, ...) 改为 torch.empty_like(res_src[1], ...),与 v1 做法保持一致,共涉及 4 处: 1. test_npu_fused_infer_attention_score_v2(第228行):torch.empty(1,...)torch.empty_like(res_src[1],...) 2. test_ifa_v2_update_with_auto_dispatch_capture(第163行):torch.empty(1,...)torch.empty_like(res_src[1],...) 3. test_ifa_v2_update_with_non_out_and_auto_dispatch_capture(第192行):torch.empty(1,...)torch.empty_like(res_src[1],...) 4. test_npu_fused_infer_attention_score_v2_no_reset(第408行):torch.empty(1,...)torch.empty_like(res_src[1],...) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写"不涉及" 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写"不涉及" 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤 **测试场景:** NPU ACL Graph Update 相关测试用例 **测试方法:** 执行修改后的测试用例,验证 softmax_lse 的 shape 与 res_src[1] 一致,断言不再报错 ```bash pytest test/npu/test_aclgraph_update.py::TestIFAAclgraphUpdate::test_npu_fused_infer_attention_score_v2 -v ``` **验证点:** - test_npu_fused_infer_attention_score_v2return_softmax_lse=Falsesoftmax_lse shape 为 (0,),与 res_src[1] 一致,断言通过 - test_ifa_v2_update_with_auto_dispatch_capture:同上 - test_ifa_v2_update_with_non_out_and_auto_dispatch_capture:同上 - test_npu_fused_infer_attention_score_v2_no_reset:同上(当前被 skip,取消 skip 后也应通过) ![image.png](https://raw.gitcode.com/user-images/assets/7404318/a8ffab7d-1a53-4094-af20-6104078b87f3/image.png 'image.png') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3647311 天前
del 32 padding size with cann version check Co-authored-by: guanlongfeng<guanlongfeng1@huawei.com> # message auto-generated for no-merge-commit merge: !33479 merge cherry-pick-mr-33196-1775788640911-auto into master del 32 padding size with cann version check Created-by: glf2016 Commit-by: guanlongfeng Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [ ] 代码注释完备,正确记录错误日志 - [ ] 代码实现进行了返回值、空指针等校验 - [ ] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!334791 个月前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
fix: lintrunner --all-files --take NEWLINE -a Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35539 merge code_check_lintrunner into master fix: lintrunner --all-files --take NEWLINE -a Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 文件必须以 LF 换行符结尾,不允许 CRLF(DOS 换行),执行: lintrunner --all-files --take NEWLINE -a # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3553915 天前
[master]fix aoe ut Co-authored-by: DaiFu<daifu2@huawei.com> # message auto-generated for no-merge-commit merge: !27470 merge 2512AoeUt into master [master]fix aoe ut Created-by: daifu1234567 Commit-by: DaiFu 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 **What does this PR do / why do we need it**: 需要走aclop才会有aoe的dump图,现在conv2d需要切aclnn,所以用例并不会保存aoe图。 **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!274705 个月前
fix ut Co-authored-by: DaiFu<daifu2@huawei.com> # message auto-generated for no-merge-commit merge: merge master into master fix ut Created-by: daifu1234567 Commit-by: DaiFu Merged-by: ascend-robot Description: fix test_binary_cross_with_logits_float16 by setting random seed See merge request: Ascend/pytorch!253077 个月前
add datatypes for HCCLUtils Co-authored-by: wangzhenwu7<5ge@live.com> # message auto-generated for no-merge-commit merge: !30221 merge master_type into master add datatypes for HCCLUtils Created-by: wangzhenwu Commit-by: wangzhenwu7 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!302213 个月前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
!7031 Rename test_npu/test_torch/test_utils/test_module Merge pull request !7031 from yuhaiyan/master-dev4 2 年前
!13038 Separate tensor.resize_ & storage.resize_ Merge pull request !13038 from 姜怡文/master_resize 1 年前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
[feat] support custom segment_size for expandable_segments Co-authored-by: XDaoHong<xudaohong@huawei.com> # message auto-generated for no-merge-commit merge: !26375 merge master into master [feat] support custom segment_size for expandable_segments Created-by: XDaoHong Commit-by: XDaoHong 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 > feature **What does this PR do / why do we need it**: 虚拟内存管理场景,增加segment_size环境变量,优化集合通信zerocopy内存映射性能 **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!263756 个月前
add set_deterministic_level Co-authored-by: SCh-zx<1325467101@qq.com> # message auto-generated for no-merge-commit merge: !30390 merge master into master add set_deterministic_level Created-by: SCh_zx Commit-by: SCh-zx 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!303903 个月前
!9224 Remove patch of torch.device Merge pull request !9224 from wuhy/remove-device-patch 2 年前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
fix: lintrunner --all-files --take NEWLINE -a Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35539 merge code_check_lintrunner into master fix: lintrunner --all-files --take NEWLINE -a Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 文件必须以 LF 换行符结尾,不允许 CRLF(DOS 换行),执行: lintrunner --all-files --take NEWLINE -a # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3553915 天前
TORCH MAIN SYNC: switch to release candidate of torch 2.12 update Co-authored-by: chansinging<chenxingying2@huawei.com> Co-authored-by: Chansinging<1183520536@qq.com> # message auto-generated for no-merge-commit merge: !35103 merge main_sync_0509 into master TORCH MAIN SYNC: switch to release candidate of torch 2.12 update Created-by: chansinging Commit-by: Chansinging;chansinging Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 同步社区演进,例行更新 lintrunner规避,见[issue](https://gitcode.com/Ascend/pytorch/issues/1865) # 【修改方案】 出包参考社区改动,https://github.com/pytorch/pytorch/pull/177570/ # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 本地A3服务器和ci流水线已跑通测试 ![image.png](https://raw.gitcode.com/user-images/assets/7404318/a7797f8a-f0ad-4dc4-860a-3c1ff2d11f53/image.png 'image.png') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3510324 天前
!7031 Rename test_npu/test_torch/test_utils/test_module Merge pull request !7031 from yuhaiyan/master-dev4 2 年前
fix: lintrunner --all-files --take NEWLINE -a Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35539 merge code_check_lintrunner into master fix: lintrunner --all-files --take NEWLINE -a Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 文件必须以 LF 换行符结尾,不允许 CRLF(DOS 换行),执行: lintrunner --all-files --take NEWLINE -a # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3553915 天前
[sync] PR-35335: [feat]: A5 only supports INF_NAN mode Co-authored-by: weixin_47897441<wuyouqi1@h-partners.com> Co-authored-by: wanglijun55<wanglijun54@huawei.com> # message auto-generated for no-merge-commit merge: !35524 merge sync-pr35335-v2.7.1-infnan-to-master into master [sync] PR-35335: [feat]: A5 only supports INF_NAN mode Created-by: ascend-ds-bot Commit-by: weixin_47897441;wanglijun55 Merged-by: ascend-robot Description: ### 1. Origin pull request: https://gitcode.com/Ascend/pytorch/merge_requests/35335 ### 2. Original pull request related issue(s): https://gitcode.com/Ascend/pytorch/issues/1918 ### 3. Original pull request related commit(s): | Sha | Datetime | Message | |---|---|---| |[92382e10](https://gitcode.com/Ascend/pytorch/commit/92382e10973ba5780721b079332366383ec841ff)|2026-05-12 21:49:33 +0800 CST|modify ut<br>| |[1352140c](https://gitcode.com/Ascend/pytorch/commit/1352140cad591b7fc472db91eb726d1b553bd65e)|2026-05-11 20:54:16 +0800 CST|fix(npu): Ascend950 only supports INF_NAN mode, bypass env var checks<br><br>Ascend950 does not support saturation mode. When users set<br>INF_NAN_MODE_ENABLE=0 or INF_NAN_MODE_FORCE_DISABLE=1 on Ascend950,<br>the code incorrectly falls into saturation mode path, causing<br>RuntimeError: SET StreamOverflowSwitch Failed.<br><br>Add early return in IsSupportInfNan() for Ascend950 to always return<br>true, making both env vars ineffective on this device.<br><br>Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com><br>| See merge request: Ascend/pytorch!3552420 天前
Event supports cross-process and cross-device (IPC event) Co-authored-by: liujunzhu<liujunzhu@huawei.com> # message auto-generated for no-merge-commit merge: !28123 merge master into master Event supports cross-process and cross-device (IPC event) Created-by: liujunzhu Commit-by: liujunzhu 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**: event能力对齐cuda,支持跨进程与跨设备使用。 CUDA跨进程共享内存和跨设备拷贝内存时使用Event进行同步,而torch npu使用SynchronizeStream进行同步,希望torch_npu支持在跨设备和跨内存的场景也使用Event进行同步,提升整体性能。另外,需支持通过Python接口在进程间传递Event对象或Event handle并使用该Event进行进程间的同步。 相关场景如下: 1、跨进程使用Event:进程间传递interprocess=True的Event对象、Event的IPC Handle或torch.multiprocessing.reductions.reduce_event(event)的结果。 2、跨进程共享NPU内存:包括进程间通过参数或队列传递Tensor、进程间通过torch.multiprocessing.reductions.reduce_tensor()传递Tensor、进程间通过_share_npu_传递Tensor。 3、跨设备拷贝NPU内存:调用Tensor.to()或Tensor.copy_()接口。 不支持跨设备或跨进程使用interprocess=False的Event。 **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!281235 个月前
!13012 [Feature]lazy call for setoption. Merge pull request !13012 from huangyunlong/2.5lz 1 年前
!16593 Fix Path Manager For Security Merge pull request !16593 from 周先琪/master_zxq 1 年前
!10831 Add test files: test_jit.py/jit. Merge pull request !10831 from yuhaiyan/master-dev1 2 年前
!10831 Add test files: test_jit.py/jit. Merge pull request !10831 from yuhaiyan/master-dev1 2 年前
fix: lintrunner --all-files --take NEWLINE -a Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35539 merge code_check_lintrunner into master fix: lintrunner --all-files --take NEWLINE -a Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 文件必须以 LF 换行符结尾,不允许 CRLF(DOS 换行),执行: lintrunner --all-files --take NEWLINE -a # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3553915 天前
[sync] PR-34231: [feat] support PYTORCH_NPU_ALLOC_CONF: large_segment_size_mb Co-authored-by: ffmh<fengminghao2@huawei.com> # message auto-generated for no-merge-commit merge: !35297 merge sync-pr34231-v2.11.0_device_alloc_conf-to-master into master [sync] PR-34231: [feat] support PYTORCH_NPU_ALLOC_CONF: large_segment_size_mb Created-by: ascend-ds-bot Commit-by: ffmh Merged-by: ascend-robot Description: ### 1. Origin pull request: https://gitcode.com/Ascend/pytorch/merge_requests/34231 ### 2. Original pull request related issue(s): https://gitcode.com/Ascend/pytorch/issues/1837 https://gitcode.com/Ascend/pytorch/issues/1795 ### 3. Original pull request related commit(s): | Sha | Datetime | Message | |---|---|---| |[cb41caf6](https://gitcode.com/Ascend/pytorch/commit/cb41caf629213b22c6dbbd5fcc4a881f35401436)|2026-05-08 15:14:02 +0800 CST|fix test case<br>| |[c29273d9](https://gitcode.com/Ascend/pytorch/commit/c29273d9a602ca3a7cb8a739ff063a5139b06ff1)|2026-05-08 10:52:28 +0800 CST|fix lint<br>| |[22920c40](https://gitcode.com/Ascend/pytorch/commit/22920c404be36851784cc76d9f55b41e930315f0)|2026-05-08 10:06:46 +0800 CST|remove redundant code<br>| |[773d5eef](https://gitcode.com/Ascend/pytorch/commit/773d5eefc12a23164b17722c3628ddcf681eca96)|2026-04-23 19:24:35 +0800 CST|support PYTORCH_NPU_ALLOC_CONF: large_segment_size_mb<br>| See merge request: Ascend/pytorch!3529721 天前
[feat] support environment variable LD_PRELOAD Co-authored-by: liujunzhu<liujunzhu@huawei.com> # message auto-generated for no-merge-commit merge: !34275 merge master into master [feat] support environment variable LD_PRELOAD Created-by: liujunzhu Commit-by: liujunzhu 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能力等内容) 用户自实现 aclrtMallocAlign32 等 ACL 符号并打包成 .so,通过 LD_PRELOAD 注入 torch_npu 进程,期望拦截对 ACL 函数的调用,但实际未被调用。 根因:torch_npu 中部分 ACL 函数(如 aclrtMallocAlign32aclrtFreePhysical)通过 FunctionLoader::Get() 使用 dlsym(handle, name) 查找符号,该方式限定在 handle 对应的库中查找,不搜索 LD_PRELOAD 预加载的库,导致覆盖失效。而直接链接调用的 ACL 符号(如 aclrtFree)走 PLT 全局符号解析,天然支持 LD_PRELOAD。 修改方案: 1. 修改 FunctionLoader::Get() 方法,当 LD_PRELOAD 环境变量非空时,优先通过 dlsym(RTLD_DEFAULT, name) 在全局符号表中查找函数,使 LD_PRELOAD 注入的同名符号可被命中;未命中时回落原有 dlopen + dlsym(handle) 路径。 2. 以 LD_PRELOAD 非空作为门控条件,未设置时完全走旧路径,行为与修改前一致。 3. 仅修改 torch_npu/csrc/core/npu/register/FunctionLoader.cpp,不新增头文件、不改变调用方。 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 测试场景:通过 LD_PRELOAD 注入自定义 aclrtMallocAlign32 实现,验证 FunctionLoader 路径的符号可被覆盖。 测试方法:子进程隔离测试,每个用例在独立子进程中设置不同 LD_PRELOAD 环境变量。 | 测试用例 | 验证内容 | |---------|---------| | 无 LD_PRELOAD | 行为与修改前一致,hook 不被调用 | | LD_PRELOAD 设置 hook so | aclrtMallocAlign32 被 hook 拦截 | | LD_PRELOAD 设置不含 ACL 符号的 so | 正确回落到原始库,功能不受影响 | | LD_PRELOAD 多 so | 先加载的 hook 优先命中 | 新增测试文件:test/npu/test_ld_preload_acl_hook.py。 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!342751 个月前
!7031 Rename test_npu/test_torch/test_utils/test_module Merge pull request !7031 from yuhaiyan/master-dev4 2 年前
!7031 Rename test_npu/test_torch/test_utils/test_module Merge pull request !7031 from yuhaiyan/master-dev4 2 年前
AI assist developer for python dt third batch for master Co-authored-by: deepSeekya<chenzhihan6@huawei.com> # message auto-generated for no-merge-commit merge: !26524 merge master into master AI assist developer for python dt third batch for master Created-by: deepSeekya Commit-by: deepSeekya Merged-by: ascend-robot Description: 【合入说明】 AI辅助研发python dt测试用例生成。 【合入来源】 AI辅助研发需求 dt测试文件覆盖率提升。 See merge request: Ascend/pytorch!265246 个月前
【feat】mstx support push and pop Co-authored-by: mei-feiyao<meifeiyao@h-partners.com> # message auto-generated for no-merge-commit merge: !36205 merge rangem into master 【feat】mstx support push and pop Created-by: mei-feiyao Commit-by: mei-feiyao Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\https://gitcode.com/Ascend/pytorch/issues/2033 > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) 对齐社区nvtx模块,补全接口,包括如下: 1、range_push、range_pop:线程粒度的打range点接口,内部走mstx库实现打点,用户可通过torch_npu.profiler接口配置mstx=True或者msproftx=True(待废弃)的方式采集tx打点数据; 2、annotate类:用户可通过with torch_npu.npu.mstx.annotate(message="xxxx", stream=xxxx, domain="tttt")的方式或者@torch_npu.npu.mstx.annotate(message="xxxx", stream=xxxx, domain="tttt")装饰器的方式对目标代码段或者目标函数进行打点,内部会在开始和结束的阶段分别调用range_push和range_pop # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 是。涉及新增接口,已联系资料同学补充资料 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 本需求只涉及新增接口,不涉及已有接口变更 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 1、UT测试验证新增接口; 2、模型代码增加调用新增的打点接口,并通过profiler采集打点数据,观察打点数据正常 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3620512 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
[feature] aclgraph support PYTORCH_NO_NPU_MEMORY_CACHING=1 master Co-authored-by: yurongkun<yurongkun@huawei.com> # message auto-generated for no-merge-commit merge: !35070 merge no_cache_master into master [feature] aclgraph support PYTORCH_NO_NPU_MEMORY_CACHING=1 master Created-by: yurongkun Commit-by: yurongkun Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > aclgraph支持PYTORCH_NO_NPU_MEMORY_CACHING 1)裸调capture时,打开PYTORCH_NO_NPU_MEMORY_CACHING不会报错,正常运行。 2)如果当前内存池无其他图持有且图内对象无依赖内存池时,释放该内存池给驱动 # 【资料变更】 > 不涉及 # 【接口变更】 > 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 新增UT看护,并运行多种场景用例。无运行报错 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3507020 天前
[feat]TensorTo support preserve_format consistent with GPU Co-authored-by: chenshuai<chenshuai81@huawei.com> # message auto-generated for no-merge-commit merge: !35355 merge cherry-pick-mr-34696-1778549007272-auto into master [feat]TensorTo support preserve_format consistent with GPU Created-by: culechan Commit-by: culechan;chenshuai Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1、NPU上tensorto支持preserve_format模式。行为逻辑上对齐pytorch原生框架 2、增加preserve_format模式相关的测试用例 # 【资料变更】 不涉及,原生API表格中未体现这部分内容 # 【接口变更】 Tensor.to默认使用且支持preserve_format模式 # 【功能验证】 ![image.png](https://raw.gitcode.com/user-images/assets/7404318/26dfe926-6f3c-4124-9680-486ed681e868/image.png 'image.png') ![image.png](https://raw.gitcode.com/user-images/assets/7404318/a46d3e66-4a4c-4f9f-9531-78b30d665b58/image.png 'image.png') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3535520 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
refactor: replace hard-coded dispatch with Registry + Template Method for NPU Graph op handlers Co-authored-by: suhaibo<suhaibo1@huawei.com> # message auto-generated for no-merge-commit merge: !31272 merge master into master refactor: replace hard-coded dispatch with Registry + Template Method for NPU Graph op handlers Created-by: suhaibo Commit-by: suhaibo 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能力等内容) 1. 拓展aclgraph update功能,支持自定义算子注册update能力,避免侵入式修改pta源码 # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” <span style="color:#0066cc;">新增register_npu_graph_handler和NpuGraphOpHandler对外接口</span> # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!312722 个月前
!9507 Add test cases and fix possible problems with cp in some environments Merge pull request !9507 from shaoyf/doc/master 2 年前
[feat] 950 not support ACL_OP_INIT_MODE=0 Co-authored-by: LiNuohang<linuohang@huawei.com> # message auto-generated for no-merge-commit merge: !36109 merge aclop-m into master [feat] 950 not support ACL_OP_INIT_MODE=0 Created-by: LiNuohang Commit-by: LiNuohang Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] 需求 - [ ] 问题单 - [ ] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 950不支持acl_op_init_mode==0,如果是950设备,acl_op_init_mode被设置成0的时候,自动转成1,并报warning # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 新增UT,测试不同设备不同设置 本地测试:pass (lnh_310_m) [linuohang@ascend127 ~]$ python /home/linuohang/test/test_temp.py [W528 15:38:42.620871180 OptionsManager.cpp:541] Warning: ========lnh mode = 1======== (function operator()) (lnh_310_m) [linuohang@ascend127 ~]$ python /home/linuohang/test/test_temp.py [W528 15:39:31.866144040 OptionsManager.cpp:541] Warning: ========lnh mode = 0======== (function operator()) (lnh_310_m) [linuohang@ascend127 ~]$ python /home/linuohang/test/test_temp.py [W528 15:39:51.578598300 OptionsManager.cpp:541] Warning: ========lnh mode = 2======== (function operator()) (lnh_310_m) [linuohang@ascend127 ~]$ python /home/linuohang/test/test_temp.py [W528 15:40:23.776321440 OptionsManager.cpp:531] Warning: Get env ACL_OP_INIT_MODE not in [0, 1, 2], so reset it to the default value 1. (function operator()) [W528 15:40:23.776356620 OptionsManager.cpp:541] Warning: ========lnh mode = 1======== (function operator()) (lnh_310_m) [linuohang@ascend127 ~]$ # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!361095 天前
!7031 Rename test_npu/test_torch/test_utils/test_module Merge pull request !7031 from yuhaiyan/master-dev4 2 年前
[sync] PR-34238: [feat] support PYTORCH_NPU_ALLOC_CONF: per_process_memory_fraction Co-authored-by: ffmh<fengminghao2@huawei.com> # message auto-generated for no-merge-commit merge: !35472 merge sync-pr34238-v2.11.0_device_alloc_conf_ppmf-to-master into master [sync] PR-34238: [feat] support PYTORCH_NPU_ALLOC_CONF: per_process_memory_fraction Created-by: ascend-ds-bot Commit-by: ffmh Merged-by: ascend-robot Description: ### 1. Origin pull request: https://gitcode.com/Ascend/pytorch/merge_requests/34238 ### 2. Original pull request related issue(s): https://gitcode.com/Ascend/pytorch/issues/1796 https://gitcode.com/Ascend/pytorch/issues/1837 ### 3. Original pull request related commit(s): | Sha | Datetime | Message | |---|---|---| |[2192500c](https://gitcode.com/Ascend/pytorch/commit/2192500c7c6cea10d297beab3943881d7e50333d)|2026-05-09 18:25:18 +0800 CST|fix test case<br>| |[12dd3694](https://gitcode.com/Ascend/pytorch/commit/12dd36948537a5e5457be1d9d5313c37e8914363)|2026-05-09 18:25:17 +0800 CST|refactor allowed_memory_maximum according to cuda caching allocator<br>| |[92c06b95](https://gitcode.com/Ascend/pytorch/commit/92c06b95e74b7e4109d7251f24486895df7e094c)|2026-05-09 18:25:17 +0800 CST|support PYTORCH_NPU_ALLOC_CONF: per_process_memory_fraction<br>| See merge request: Ascend/pytorch!3547220 天前
fix: lintrunner --all-files --take NEWLINE -a Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35539 merge code_check_lintrunner into master fix: lintrunner --all-files --take NEWLINE -a Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 文件必须以 LF 换行符结尾,不允许 CRLF(DOS 换行),执行: lintrunner --all-files --take NEWLINE -a # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3553915 天前
!23631 release gil when AclSetCompileopt Merge pull request !23631 from huangyunlong/2.9aclop 9 个月前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
!7031 Rename test_npu/test_torch/test_utils/test_module Merge pull request !7031 from yuhaiyan/master-dev4 2 年前
[feat] Add disable_tensor_unsafe_check option to restart_device Co-authored-by: LiNuohang<linuohang@huawei.com> # message auto-generated for no-merge-commit merge: !35732 merge biaozang-m into master [feat] Add disable_tensor_unsafe_check option to restart_device Created-by: LiNuohang Commit-by: LiNuohang Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 需求背景: 推理场景,不需要更新权重数据,因此发生uce故障时,存在只做流恢复,不需要做数据标脏和恢复的场景。当前快恢流恢复和数据标脏通过同一个配置项rebuild_all_resources控制,导致该场景无法使用,需要为数据标脏单独增加配置项。 当前现状: 当前快恢流恢复和数据标脏通过同一个配置项rebuild_all_resources控制 具体设计方案: 描述:restart_device接口增加disable_tensor_unsafe_check开关,用于单独控制是否对数据做标脏处理 为保证兼容性,默认为False,且仅在rebuild_all_resource为True时生效,即: rebuild_all_resources = True, disable_tensor_unsafe_check = True, 不做数据标脏 rebuild_all_resources = True, disable_tensor_unsafe_check= False, 做数据标脏 rebuild_all_resources = False, disable_tensor_unsafe_check= True, 不做数据标脏 rebuild_all_resources = False, disable_tensor_unsafe_check= False, 不做数据标脏 # 【资料变更】 restart_device接口增加disable_tensor_unsafe_check开关 # 【接口变更】 restart_device接口增加disable_tensor_unsafe_check开关 # 【功能验证】 已新增UT # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3573214 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
round_size pad 32 byte Co-authored-by: zhaoyu<nanzhaogang@qq.com> # message auto-generated for no-merge-commit merge: !28316 merge ascend-master into master round_size pad 32 byte Created-by: zhaoyu65 Commit-by: zhaoyu 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 **What does this PR do / why do we need it**: round_size增加32byte,避免aclnn算子内存问题 **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!283165 个月前
add record_stream sanitizer Co-authored-by: bellatan<tanmei2@huawei.com> Co-authored-by: hb_hubin<hubin79@huawei.com> # message auto-generated for no-merge-commit merge: !34841 merge record_stream_sanitizer into master add record_stream sanitizer Created-by: bellatan Commit-by: bellatan;hb_hubin 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能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 本地验证 1. test/npu/test_sanitizer.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/db51597e-f6bf-4b34-8ba1-170ba8bb5bde/image.png 'image.png') 2. test/npu/test_sanitizer_record_stream.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/630b87e8-dc9c-4c9a-a2d4-932b9ad18dca/image.png 'image.png') 3. test/test_npu_sanitizer.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/ecb4d1f1-aef9-4b9b-a082-75ff16991064/image.png 'image.png') 4. test/test_sanitizer_pluggable_allocator.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/ffa87f39-c755-41fe-8176-9cb38cd73a09/image.png 'image.png') 5. ci结果 ·UT_ARM_A2_Part_01:test/test_npu_sanitizer.py,pass ![image.png](https://raw.gitcode.com/user-images/assets/7404318/d5fb5242-cb11-435d-ae2b-36960a9522f8/image.png 'image.png') ·UT_ARM_A2_Part_02:test/npu/test_sanitizer.py,pass;test/test_sanitizer_pluggable_allocator.py pass ![1778915605465.png](https://raw.gitcode.com/user-images/assets/7404318/243673b4-b5b0-4c5d-8c21-3d22f84cce82/1778915605465.png '1778915605465.png') ·UT_ARM_A2_Part_03:test/npu/test_sanitizer_record_stream.py,pass ![1778915660126.png](https://raw.gitcode.com/user-images/assets/7404318/b1e2f979-f4f7-4f24-b4b9-b1987de33677/1778915660126.png '1778915660126.png') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3484113 天前
add record_stream sanitizer Co-authored-by: bellatan<tanmei2@huawei.com> Co-authored-by: hb_hubin<hubin79@huawei.com> # message auto-generated for no-merge-commit merge: !34841 merge record_stream_sanitizer into master add record_stream sanitizer Created-by: bellatan Commit-by: bellatan;hb_hubin 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能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 本地验证 1. test/npu/test_sanitizer.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/db51597e-f6bf-4b34-8ba1-170ba8bb5bde/image.png 'image.png') 2. test/npu/test_sanitizer_record_stream.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/630b87e8-dc9c-4c9a-a2d4-932b9ad18dca/image.png 'image.png') 3. test/test_npu_sanitizer.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/ecb4d1f1-aef9-4b9b-a082-75ff16991064/image.png 'image.png') 4. test/test_sanitizer_pluggable_allocator.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/ffa87f39-c755-41fe-8176-9cb38cd73a09/image.png 'image.png') 5. ci结果 ·UT_ARM_A2_Part_01:test/test_npu_sanitizer.py,pass ![image.png](https://raw.gitcode.com/user-images/assets/7404318/d5fb5242-cb11-435d-ae2b-36960a9522f8/image.png 'image.png') ·UT_ARM_A2_Part_02:test/npu/test_sanitizer.py,pass;test/test_sanitizer_pluggable_allocator.py pass ![1778915605465.png](https://raw.gitcode.com/user-images/assets/7404318/243673b4-b5b0-4c5d-8c21-3d22f84cce82/1778915605465.png '1778915605465.png') ·UT_ARM_A2_Part_03:test/npu/test_sanitizer_record_stream.py,pass ![1778915660126.png](https://raw.gitcode.com/user-images/assets/7404318/b1e2f979-f4f7-4f24-b4b9-b1987de33677/1778915660126.png '1778915660126.png') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3484113 天前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
!22805 Update to v2.9.0 Merge pull request !22805 from dilililiwhy/main_sync_20250710 9 个月前
!9511 [fix]Serialization nd desc. Merge pull request !9511 from huangyunlong/2.3ser 2 年前
!7031 Rename test_npu/test_torch/test_utils/test_module Merge pull request !7031 from yuhaiyan/master-dev4 2 年前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
add torch_npu._C._npu_getCurrentRawStreamNoWait() Co-authored-by: liujunzhu<liujunzhu@huawei.com> # message auto-generated for no-merge-commit merge: !29739 merge master into master add torch_npu._C._npu_getCurrentRawStreamNoWait() Created-by: liujunzhu Commit-by: liujunzhu 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**: 现有的torch_npu._C._npu_getCurrentRawStream()由于清空taskqueue导致性能比较差,所以添加不清空taskqueue的torch_npu._C._npu_getCurrentRawStreamNoWait()接口。 由于新增的torch_npu._C._npu_getCurrentRawStreamNoWait(device)接口不清空taskqueue,如果既使用返回的aclrtStream下发任务又使用torch_npu的taskqueue下发任务,则会引起保序问题,需由用户确保只使用其中的一种下发方式(如果混用需确保无数据依赖且性能不敏感)。 **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!297394 个月前
AI assist developer for python dt third batch for master Co-authored-by: deepSeekya<chenzhihan6@huawei.com> # message auto-generated for no-merge-commit merge: !26524 merge master into master AI assist developer for python dt third batch for master Created-by: deepSeekya Commit-by: deepSeekya Merged-by: ascend-robot Description: 【合入说明】 AI辅助研发python dt测试用例生成。 【合入来源】 AI辅助研发需求 dt测试文件覆盖率提升。 See merge request: Ascend/pytorch!265246 个月前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
Update LocalScalarDenseNpu and include ATen/Dispatch_v2.h to support more data types. Co-authored-by: wangzhenwu7<5ge@live.com> # message auto-generated for no-merge-commit merge: !27195 merge master into master Update LocalScalarDenseNpu and include ATen/Dispatch_v2.h to support more data types. Created-by: wangzhenwu Commit-by: wangzhenwu7 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!271955 个月前
[Fix] Fix static check errors detected by SPACES Co-authored-by: huangjingwei<huangjingwei4@huawei.com> # message auto-generated for no-merge-commit merge: !35981 merge master_lintrunner into master [Fix] Fix static check errors detected by SPACES Created-by: huangjingwei Commit-by: huangjingwei Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 检测和删除代码中的行尾空白字符 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 不涉及 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!3598112 天前
!9500 The test cases support NPU. Merge pull request !9500 from yuhaiyan/master-dev4 2 年前
AI assist developer for python DT master Co-authored-by: deepSeekya<chenzhihan6@huawei.com> # message auto-generated for no-merge-commit merge: !26305 merge master into master AI assist developer for python DT master Created-by: deepSeekya Commit-by: deepSeekya Merged-by: ascend-robot Description: 【合入说明】 AI辅助研发python dt测试用例生成。 【合入来源】 AI辅助研发需求 dt测试文件覆盖率提升。 See merge request: Ascend/pytorch!263056 个月前
!12204 Fix the failed tests. Merge pull request !12204 from yuhaiyan/master-dev4 1 年前
!17747 支持配置FFT PLAN Merge pull request !17747 from zhanglei/master 1 年前
修复API入参校验和用例适配 Co-authored-by: bellatan<tanmei2@huawei.com> # message auto-generated for no-merge-commit merge: !36469 merge fix_api_validation into master 修复API入参校验和用例适配 Created-by: bellatan Commit-by: bellatan Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 ### 1. device 入参类型缺少校验,导致非法 device 未按预期报错 **API:** set_device_limit(device, cube_num, vector_num)get_device_limit(device) **API 原始约束:** set_device_limitget_device_limitdevice 参数语义是指定 NPU 设备卡号,应传入明确的 NPU 设备 ID。 **当前问题:** 传入 Nonefloat 等非 int 类型时未报错,不符合 API 参数约束。 **根因分析:** 原实现中对入参 device 使用了 _get_device_index(device, optional=True) 对入参 device 进行兼容性处理,导致约束之外的非法入参没有被及时拒绝。 **解决方案:** 针对 set_device_limit/get_device_limit 这两个 API,不再使用 _get_device_index(device, optional=True) 做宽松解析,而是直接按照 API 约束对原始 device 参数做严格校验。 新加校验规则: 1. device 必须是 int; 2. device 不能是 bool; ```python if isinstance(device, bool) or not isinstance(device, int): raise TypeError( "device must be an int, but got {}{}".format( type(device).__name__, pta_error(ErrCode.TYPE) ) ) ``` **涉及的修改文件**:torch_npu/npu/npu_config.py ### 2. allow_hf32 入参类型缺少校验,导致非 bool 入参被错误接受 **API:** matmul.allow_hf32conv.allow_hf32 **API 原始约束:** torch_npu.npu.matmul.allow_hf32 的语义是控制 MatMul 类算子是否允许使用 HF32 计算,应作为布尔型配置开关使用。 torch_npu.npu.conv.allow_hf32 的语义是控制 Conv 类算子是否允许使用 HF32 计算,应作为布尔型配置开关使用。 **当前问题:** allow_hf32 缺少 bool 类型校验,传入非 bool 类型没有报错,不符合 API 参数约束。 **根因分析:** 原实现直接"enable" if value else "disable",根据 Python 对象的真假值进行判断,未判断 value 是否为 bool 类型,导致非法类型未被拒绝。 **解决方案:** 新增 isinstance(value, bool) 校验,非 bool 类型直接抛出 TypeError,避免非法入参被隐式转换为开关配置。在 _allowHF32Matmul.__setattr___allowHF32Conv.__setattr__allow_hf32 分支中增加 bool 类型校验。 新加校验规则: 1. allow_hf32 必须是 bool; 2. 只允许 TrueFalse; 3. intstrNonelistdict 等非 bool 类型均抛出 TypeError。 ```python if name == "allow_hf32": if not isinstance(value, bool): raise TypeError( "allow_hf32 must be a bool, but got {}{}".format( type(value).__name__, pta_error(ErrCode.TYPE) ) ) ``` **涉及的修改文件**:torch_npu/npu/npu_config.py ### 3. 用例适配 用例:test\nn\test_module_hooks.py,用例名:test_hook_inplace 问题:用例ci失败,报错正则匹配失败 根因:改用例预期报错的接口有变更,torch==2.12预期报错接口名为**BackwardHookFunctionBackward**,torch==2.13预期报错接口名变更为**BackwardHookFunction**。 解决:开放用例,用例报错提示适配,兼容两个版本的torch: with self.assertRaisesRegex(RuntimeError, "Output 0 of BackwardHookFunctionBackward is "修改为with self.assertRaisesRegex(RuntimeError, "Output 0 of BackwardHookFunction(Backward)? is " with self.assertRaisesRegex(RuntimeError, "BackwardHookFunction(Backward)? is a view "修改为with self.assertRaisesRegex(RuntimeError, "Output 0 of BackwardHookFunction(Backward)? is " # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 已有用例本地验证pass,CI pass 1. 新加用例:test/npu/test_torch_npu.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/a041fbeb-16cd-4654-9865-a4a02d96df17/image.png 'image.png') ![image.png](https://raw.gitcode.com/user-images/assets/7404318/c353f1d5-03d3-4300-9277-f8ce71e641ae/image.png 'image.png') 2. 已有用例:test/npu/test_torch_backends.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/1116053c-a3ab-4b93-b3da-99e1f864d63d/image.png 'image.png') 3. 已有用例:test/nn/test_module_hooks.py ![image.png](https://raw.gitcode.com/user-images/assets/7404318/90e9cb29-e0f0-4bdb-a744-a23be66a92a5/image.png 'image.png') # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!364699 天前
!12989 UCE REPAIR Merge pull request !12989 from sunjiayang/uce_stop_master 1 年前
pta supports to create nested tensor Co-authored-by: chenshuai<chenshuai81@huawei.com> # message auto-generated for no-merge-commit merge: !29723 merge nestedTensor into master pta supports to create nested tensor Created-by: culechan Commit-by: chenshuai 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!297234 个月前
!7031 Rename test_npu/test_torch/test_utils/test_module Merge pull request !7031 from yuhaiyan/master-dev4 2 年前