| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
[master][Fix] Fix static check errors detected by CODESPELL Co-authored-by: thickhair<zp2165064878@163.com> # message auto-generated for no-merge-commit merge: !38552 merge code_spell_fix_master into master [master][Fix] Fix static check errors detected by CODESPELL Created-by: thickhair Commit-by: thickhair 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/1865 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38552 | 2 个月前 | |
| 2 年前 | ||
test(jit):add test for ScriptFunction,ScriptFunction.get_debug_state,ScriptFunction.save,and ScriptFunction.save_to_buffer Co-authored-by: fengwu154<1067935138@qq.com> # message auto-generated for no-merge-commit merge: !35412 merge test-torch-jit-ScriptFunction-master into master test(jit):add test for ScriptFunction,ScriptFunction.get_debug_state,ScriptFunction.save,and ScriptFunction.save_to_buffer Created-by: fengwu154 Commit-by: fengwu154 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 https://gitcode.com/Ascend/pytorch/issues/1904 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1. ** get_debug_state 适配** - 使用 PyTorch 内置的 enable_profiling_mode_for_profiling_tests() 上下文强制启用 profiling executor。 - 执行两次函数(一次 profile,一次 optimize),确保优化计划生成。 - 通过 GRAPH_EXECUTOR 常量判断执行器模式,非 profiling 模式自动跳过测试。 2. **save 适配** - API 签名仅接受字符串路径,因此使用 tempfile.TemporaryDirectory 创建临时文件,避免对文件系统的污染。 3. **save_to_buffer 适配** - 验证返回类型为 bytes,并通过 io.BytesIO 模拟文件流加载,与保存前输出一致。 - **原测试缺口**:test_jit.py 虽大量使用 ScriptFunction,但缺少对其类型、save_to_buffer 及 save 直接路径的专门测试;get_debug_state 仅在特定测试中偶现调用,未系统验证。 - **新增覆盖**: - 类型断言:确保 @torch.jit.script 生成的函数为 torch.jit.ScriptFunction 实例。 - 调试状态:验证在 profiling 模式下两次执行后可获得有效状态对象。 - 序列化闭环:通过 save_to_buffer → load 和 save(file) → load 验证序列化后语义等价。 - **边界适配**:get_debug_state 通过 @unittest.skipIf(GRAPH_EXECUTOR != ProfilingMode.PROFILING, ...) 仅在有 profiling 执行器的环境中运行,避免内部断言错误。 - 新增测试文件 test/jit/test_jit_ScriptFunction.py。 - 实现 4 个测试用例,覆盖 ScriptFunction 类型、调试状态获取、内存序列化与文件序列化。 - 使用条件跳过(@unittest.skipIf)适配不同执行器模式(profiling / simple / legacy)。 - 不依赖外部文件,所有测试可在任意环境运行。 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 root@devserver-fae-mirrors:/home/aicc/wf/api/2.7.1/pytorch/test# python test_jit_ScriptFunction.py .... ---------------------------------------------------------------------- Ran 4 tests in 10.120s OK 覆盖版本: v2.7.1 v2.9.0 v2.10.0 v2.11.0 v2.12.0 master # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!35412 | 3 个月前 | |
Adapt test_jit_is_trancing in trace for NPU Co-authored-by: qq_42437014<yandj5@163.com> # message auto-generated for no-merge-commit merge: !37098 merge test-jit-is_tracing-in-trace-master into master Adapt test_jit_is_trancing in trace for NPU Created-by: qq_42437014 Commit-by: qq_42437014 Merged-by: ascend-robot Description: # 【合入来源】 [[Usage]: torch.jit.is_tracing () ----此API,在trace模式下,测试样例缺失](https://gitcode.com/Ascend/pytorch/issues/1706) > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] issue/工单 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) ## API 功能 torch.jit.istracing 是 TorchScript 核心执行模式判断 API,用于在静态图编译与执行阶段检测当前代码是否处于 tracing 编译上下文,支持在 tracing / scripting 混合编码场景下实现条件分支、执行路径切换、图编译行为适配,保障不同执行模式下代码逻辑的正确性,是 TorchScript 动态适配、图优化、模式感知的基础能力。 ## 测试用例说明 1. scrpit模式下,API torch.jit.is_tracing () PyTorch 官方 test_jit.py(官方路径: pytorch/test/test_jit.py;行号位置:两个测试用例的位置大概在9783-9798行)包含test_script_is_tracing、test_script_get_tracing_state 两个测试用例。 **测试用例详解** • test_script_get_tracing_state:调用底层私有接口判定追踪状态,依托NPU张量运算分支结果,校验底层接口识别追踪模式的有效性。 • test_script_is_tracing:使用官方标准接口判断追踪状态,结合NPU张量执行脚本编译校验,验证公开接口在图追踪场景下判定逻辑正常。 2. trace模式下,API torch.jit.is_tracing () 添加新测试用例test/test_jit_is_tracing_in_trace.py • 基础环境适配:引入torch_npu库启用NPU设备能力,构造NPU张量作为测试输入数据 • 核心功能验证:校验进入JIT轨迹录制流程时,接口可正确返回真值 **测试用例详解** • test_is_tracing_returns_true_in_trace_mode:基于接口返回结果编写分支判断逻辑,使用NPU张量执行轨迹录制。通过最终运算输出结果,确认程序成功走入轨迹模式分支,验证接口状态判定逻辑有效。 **测试用例构造说明** 由于 PyTorch 的 torch.jit.trace 机制限制,在被追踪函数内部执行时,底层的 Python 级追踪标志位(tracing flag)依然保持为 False,因此无法直接在函数内部进行断言验证。本测试转而采用严格的“行为验证”方案:利用 Tracer “仅记录单条执行路径”的特性,通过校验最终的输出结果,反向证明 is_tracing() 成功触发了目标分支,且该计算路径已被正确固化到 TorchScript 图中。 ## NPU 适配说明 1. scrpit模式下,API torch.jit.is_tracing ()适配说明 torch.jit.istracing 为 TorchScript 前端执行模式检测 API,无硬件相关底层算子依赖,NPU 完全兼容 PyTorch 原生实现,功能行为、状态语义、编译逻辑与 CPU 保持一致。此测试样例无需修改,可直接测试验证。 • 基础环境适配:将仓库test_upstream/test/test_jit.py.patch,进行apply之后,已有import torch_npu基础环境的适配; • 张量设备调整:将仓库test_upstream/test/test_jit.py.patch,进行apply之后,代码已将cpu的张量修改为npu上运行。确保异步计算的结果载体(张量)运行在 NPU 上,贴合 NPU 场景使用需求。 2. trace模式下,API torch.jit.is_tracing ()适配说明 新增测试用例:test/test_jit_is_tracing_in_trace.py,补齐NPU设备场景下接口相关测试覆盖。 • 基础环境适配:引入torch_npu库启用NPU设备能力,构造NPU张量作为测试输入数据。 # 【资料变更】 **需要添加2.9.0~2.12.0的API说明** 在 https://gitcode.com/Ascend/pytorch/tree/v2.7.1/docs/zh/native_apis 的文档中进行查找与验证。该目录下的pytorch_2-7-1文件夹下的torch-jit.md有API的说明,"torch.jit.is_tracing"全部标注"是 支持fp32"。 pytorch_2-9-0~pytorch_2-12-0没有对此API的说明,故对pytorch_2-9-0、pytorch_2-10-0、pytorch_2-11-0、pytorch_2-12-0文件夹下的torch-jit.md添加了API的说明,"torch.jit.is_tracing"全部标注"是 支持fp32"。 # 【接口变更】 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 **测试命令:** #script模式下,测试命令 cd pytorch/test python -m unittest test_jit.TestScript.test_script_is_tracing test_jit.TestScript.test_script_get_tracing_state -v #trace模式下,测试命令 cd pytorch/test python test_jit_is_tracing_in_trace.py -v **测试结果:** 1. script模式下,测试结果 `` root@5534245c24de:/workspace/user_data/527/pytorch/test_upstream#python -m unittest test_jit.TestScript.test_script_is_tracing test_jit.TestScript.test_script_get_tracing_state -v /usr/local/python3.11.14/lib/python3.11/site-packages/torch_npu/contrib/transfer_to_npu.py:362: ImportWarning: ************************************************************************************************************* The torch.Tensor.cuda and torch.nn.Module.cuda are replaced with torch.Tensor.npu and torch.nn.Module.npu now.. The torch.cuda.DoubleTensor is replaced with torch.npu.FloatTensor cause the double type is not supported now.. The backend in torch.distributed.init_process_group set to hccl now.. The torch.cuda.* and torch.cuda.amp.* are replaced with torch.npu.* and torch.npu.amp.* now.. The device parameters have been replaced with npu in the function below: torch.logspace, torch.randint, torch.hann_window, torch.rand, torch.full_like, torch.ones_like, torch.rand_like, torch.randperm, torch.arange, torch.frombuffer, torch.normal, torch._empty_per_channel_affine_quantized, torch.empty_strided, torch.empty_like, torch.scalar_tensor, torch.tril_indices, torch.bartlett_window, torch.ones, torch.sparse_coo_tensor, torch.randn, torch.kaiser_window, torch.tensor, torch.triu_indices, torch.as_tensor, torch.zeros, torch.randint_like, torch.full, torch.eye, torch._sparse_csr_tensor_unsafe, torch.empty, torch._sparse_coo_tensor_unsafe, torch.blackman_window, torch.zeros_like, torch.range, torch.sparse_csr_tensor, torch.randn_like, torch.from_file, torch._cudnn_init_dropout_state, torch._empty_affine_quantized, torch.linspace, torch.hamming_window, torch.empty_quantized, torch._pin_memory, torch.load, torch.set_default_device, torch.get_device_module, torch.sparse_compressed_tensor, torch.Tensor.new_empty, torch.Tensor.new_empty_strided, torch.Tensor.new_full, torch.Tensor.new_ones, torch.Tensor.new_tensor, torch.Tensor.new_zeros, torch.Tensor.to, torch.Tensor.pin_memory, torch.nn.Module.to, torch.nn.Module.to_empty ************************************************************************************************************* warnings.warn(msg, ImportWarning) /usr/local/python3.11.14/lib/python3.11/site-packages/torch_npu/contrib/transfer_to_npu.py:291: RuntimeWarning: torch.jit.script and torch.jit.script_method will be disabled by transfer_to_npu, which currently does not support them, if you need to enable them, please do not use transfer_to_npu. warnings.warn(msg, RuntimeWarning) /usr/local/python3.11.14/lib/python3.11/site-packages/torch/jit/_script.py:362: DeprecationWarning: torch.jit.script_method is deprecated. Please switch to torch.compile or torch.export. warnings.warn( monkeytype is not installed. Skipping tests for Profile-Directed Typing test_script_is_tracing (test_jit.TestScript.test_script_is_tracing) ... /usr/local/python3.11.14/lib/python3.11/site-packages/torch/jit/_script.py:1480: DeprecationWarning: torch.jit.script is deprecated. Please switch to torch.compile or torch.export. warnings.warn( /usr/local/python3.11.14/lib/python3.11/site-packages/torch/jit/_serialization.py:89: DeprecationWarning: torch.jit.save is deprecated. Please switch to torch.export. warnings.warn( /usr/local/python3.11.14/lib/python3.11/site-packages/torch/jit/_serialization.py:176: DeprecationWarning: torch.jit.load is deprecated. Please switch to torch.export. warnings.warn( ok test_script_get_tracing_state (test_jit.TestScript.test_script_get_tracing_state) ... ok ---------------------------------------------------------------------- Ran 2 tests in 0.160s 2. trace模式下,测试结果 root@5534245c24de:/workspace/user_data/527/pytorch/test/jit# python test_jit_is_tracing_in_trace.py -v test_is_tracing_returns_true_in_trace_mode (__main__.TestJitIsTracing.test_is_tracing_returns_true_in_trace_mode) Validates that torch.jit.is_tracing() returns True during trace recording. ... /usr/local/python3.11.14/lib/python3.11/site-packages/torch/jit/_trace.py:1000: DeprecationWarning: torch.jit.trace is deprecated. Please switch to torch.compile or torch.export. warnings.warn( ok ---------------------------------------------------------------------- Ran 1 test in 1.373s OK `` **验证结论:** NPU 环境运行script/trace模式下的测试用例,三个用例执行成功,无功能失败项。torch.jit.is_tracing 模式检测、状态返回、控制流分支适配等能力均符合 PyTorch 标准语义,适配完成且验证通过 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!37098 | 3 个月前 | |
test: add unit tests for torch.jit.ScriptModule.cuda and code_with_constants Co-authored-by: sxj731533731<13791252840@163.com> # message auto-generated for no-merge-commit merge: !41627 merge fix_master into master test: add unit tests for torch.jit.ScriptModule.cuda and code_with_constants Created-by: sxj731533731 Commit-by: sxj731533731 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**https://gitcode.com/Ascend/pytorch/issues/2857**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 本次修改为在 test/ 目录下新增针对 torch.jit.ScriptModule 类中 cuda 和 code_with_constants 两个 API 的单元测试用例,具体实现如下: 测试用例文件新增:在 test/jit/ 目录下修改测试文件(如test_scriptmodule.py),继承 PyTorch 标准测试基类 TestCase。 cuda() API 测试: 注:当前在 NPU 环境下无法使用 cuda() 接口(因该接口强依赖 NVIDIA CUDA 运行时),该用例将被跳过; code_with_constants API 测试: 构造包含常量(如 torch.tensor 常量、int 常量等)的 ScriptModule,并通过 torch.jit.script 转换。访问 code_with_constants 属性,断言返回值为包含两个元素的元组:第一个元素为 str 类型的计算图源码,第二个元素为 ConstMap 类型的常量映射。 # 【资料变更】 > “不涉及” # 【接口变更】 >“不涉及” # 【功能验证】 测试场景与测试方法: code_with_constants 属性验证,构造含多种常量的 ScriptModule,断言 code_with_constants 返回值的结构和内容 返回 (str, ConstMap),且常量值匹配 具体demo如下: python def test_script_module_code_with_constants(self): """Test code_with_constants API extraction and inference on NPU device.""" if not hasattr(torch, "npu") or not torch.npu.is_available(): self.skipTest("NPU device is unavailable, skip this test case") # Define a model containing tensor constants and control flow class ModelWithConstants(torch.nn.Module): def __init__(self): super().__init__() self.conv = torch.nn.Conv2d(1, 1, kernel_size=3, padding=1) self.threshold = 0.5 # Register a tensor as a buffer to act as a constant in TorchScript self.register_buffer('scale_factor', torch.tensor([2.0])) def forward(self, x): x = self.conv(x) x = x * self.scale_factor if x.mean() > self.threshold: x = x + 1.0 return x # Initialize model and convert to ScriptModule model = ModelWithConstants() scripted_model = torch.jit.script(model).npu() # Move model to NPU and check device placement self._check_model_device(scripted_model, "npu") # Verify the functionality of code_with_constants API result = scripted_model.code_with_constants code_str, constants = result # Verify the extracted code is a string and contains the forward function signature self.assertIsInstance(code_str, str) self.assertIn("def forward", code_str) # Verify the constants object type self.assertIsInstance(constants, torch.jit._script.ConstMap) 测试命令:python test_jit_scriptmodule.py 测试结果:  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!41627 | 5 天前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
[master][Fix] Fix static check errors detected by CODESPELL Co-authored-by: thickhair<zp2165064878@163.com> # message auto-generated for no-merge-commit merge: !38552 merge code_spell_fix_master into master [master][Fix] Fix static check errors detected by CODESPELL Created-by: thickhair Commit-by: thickhair 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/1865 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” # 【功能验证】  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38552 | 2 个月前 | |
| 2 年前 | ||
refactor: remove unsupported api interception patches Co-authored-by: zhounan0730<zhounan46@huawei.com> # message auto-generated for no-merge-commit merge: !43782 merge master into master refactor: remove unsupported api interception patches Created-by: zhounan0730 Commit-by: zhounan0730 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 https://gitcode.com/Ascend/pytorch/issues/3682 - [ ] 需求 - [ ] 问题单 - [ ] issue/工单 - [x] 重构优化 - [ ] 资料更新 # 【修改方案】 移除 torch_npu 对 6 个 PyTorch 模块方法( nn.Module.share_memory 与 torch.jit.ScriptModule.add_module / bfloat16 / register_buffer / register_parameter / register_module)的 monkey-patch 拦截机制,并**整体删除torch_npu/utils/npu_intercept.py**。其中仍被使用的 CANN 包检测逻辑(_cann_package_check() 与 cann_pytorch_version_map)**迁移**至 torch_npu/_init/registry/registry_manager.py(其唯一调用点所在)。- test/npu/test_unsupport_api.py:删除 6 项 *_runtimeerror 拦截测试;test_Module_share_memory_runtimeerror 改为断言 NPU 上正常执行;test/jit/test_script_module.py:TestScriptModuleShareMemory.test_share_memory_on_npu_raises改为断言 NPU 上正常执行;TestScriptModuleMetadata 的 2 项 raise 测试删除。 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 | 测试 | 削减前 | 削减后 | | --- | --- | --- | | test/npu/test_unsupport_api.py | 13 passed | 7 passed, 6 failed | | test/jit/test_script_module.py(ShareMemory/Metadata 类) | 11 passed | 8 passed, 3 failed | candidate 的 9 项失败全部为原拦截 raise 测试: - share_memory / bfloat16:不再抛错(功能可用)——**预期行为变更**; - add_module / register_module:原生 RuntimeError(消息不同); - register_parameter / register_buffer:原生 AttributeError(类型不同)。 官方用例对照 | 官方用例 | 位置 | 实测结果 | | --- | --- | --- | | test_module_share_memory(@onlyPRIVATEUSE1,NPU ) | test/test_torch.py | 削减后 **PASS** / 削减前 **FAIL**(被拦截抛错)——保留拦截补丁会使官方用例失败,删除后通过 | | test_share_memory(CPU storage shared 语义) | test/test_nn.py | 削减后 **PASS** | test_jit.py 中与本修改相关的官方用例全部通过 对进行削减的6个api在npu和gpu环境下进行调用,获取其输出结果,观察削减后两个环境中代码运行结果是否一致 npu运行结果 (Ascend 910B4,PyTorch: 2.13.0) 结果说明:这里主要考虑行为的一致,pass/fail仅表示是否会报错,若fail,则看报错信息是否一致。 削减后 ============================================================ 1. 构造时调用 (ScriptModule __init__ 中) ============================================================ PASS | add_module/register_buffer/register_parameter/register_module in __init__ ============================================================ 2. traced ScriptModule 构造后调用 ============================================================ FAIL | add_module on traced | RuntimeError: Cannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing modul PASS | bfloat16 on traced FAIL | register_buffer on traced | AttributeError: cannot assign buffer before Module.__init__() call FAIL | register_parameter on traced | AttributeError: cannot assign parameter before Module.__init__() call FAIL | register_module on traced | RuntimeError: Cannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing modul ============================================================ 3. scripted ScriptModule 构造后调用 ============================================================ FAIL | add_module on scripted | RuntimeError: Cannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing modul FAIL | bfloat16 on scripted | RuntimeError: bfloat16 is not supported on ScriptModules FAIL | register_buffer on scripted | RuntimeError: Can't add a new parameter after ScriptModule construction. Tried to add 'b FAIL | register_parameter on scripted | RuntimeError: Can't add a new parameter after ScriptModule construction. Tried to add 'p FAIL | register_module on scripted | RuntimeError: Cannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing modul ============================================================ 4. share_memory on nn.Module ============================================================ PASS | share_memory (no-op, return self, device stays npu) cuda运行结果(torch==2.13.0+cu126) ============================================================ 1. 构造时调用 (ScriptModule __init__ 中) ============================================================ PASS | add_module/register_buffer/register_parameter/register_module in __init__ ============================================================ 2. traced ScriptModule 构造后调用 ============================================================ FAIL | add_module on traced | RuntimeError: Cannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing modul PASS | bfloat16 on traced FAIL | register_buffer on traced | AttributeError: cannot assign buffer before Module.__init__() call FAIL | register_parameter on traced | AttributeError: cannot assign parameter before Module.__init__() call FAIL | register_module on traced | RuntimeError: Cannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing modul ============================================================ 3. scripted ScriptModule 构造后调用 ============================================================ FAIL | add_module on scripted | RuntimeError: Cannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing modul FAIL | bfloat16 on scripted | RuntimeError: bfloat16 is not supported on ScriptModules FAIL | register_buffer on scripted | RuntimeError: Can't add a new parameter after ScriptModule construction. Tried to add 'b FAIL | register_parameter on scripted | RuntimeError: Can't add a new parameter after ScriptModule construction. Tried to add 'p FAIL | register_module on scripted | RuntimeError: Cannot re-assign modules in a ScriptModule with non-scripted module, tried to replace existing modul ============================================================ 4. share_memory on nn.Module ============================================================ PASS | share_memory (no-op, return self, device stays cuda) 削减后api调用的测试结果与cuda上一致 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正********确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!43782 | 26 天前 | |
| 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 5 天前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 | ||
| 26 天前 | ||
| 2 年前 |