| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
modify document Co-authored-by: m0_68000167<wangzhiyuan86@h-partners.com> # message auto-generated for no-merge-commit merge: !45563 merge master into master modify document Created-by: m0_68000167 Commit-by: m0_68000167 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [ ] 需求 - [ ] 问题单 - [x] issue/工单https://gitcode.com/Ascend/op-plugin/issues/320 - [ ] 重构优化 - [x] 资料更新 # 【修改方案】 doc-tool问题扫描修改 # 【资料变更】 涉及 # 【接口变更】 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!45563 | 6 天前 | |
docs: add torch.SymFloat.is_integer support status for 2.7.1 Co-authored-by: is_Dobby_<15703541158@163.com> # message auto-generated for no-merge-commit merge: !44847 merge symfloat-is-integer-master into master docs: add torch.SymFloat.is_integer support status for 2.7.1 Created-by: lihaofei-2026 Commit-by: is_Dobby_ Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 关联任务issue:https://gitcode.com/Ascend/pytorch/issues/3577 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [x] 资料更新 # 【修改方案】 补齐 torch.SymFloat.is_integer 的 NPU API 支持资料。 更新 PyTorch 2.7.1 对应的 torch.md,在 torch.SymFloat 下新增 is_integer() 子方法条目,标记为支持。 SymFloat.is_integer 是纯 Python 层符号浮点方法,判断浮点值是否为整数,不涉及设备侧计算,无需 NPU 适配。 # 【资料变更】 涉及。更新以下文件: - docs/zh/api/native_api/pytorch_2-7-1/torch.md 新增 torch.SymFloat.is_integer 子方法条目,支持情况标记为 ✔(Atlas A2、Atlas A3、Ascend 950DT 均支持)。 仅补充 2.7.1 版本,因为该 API 仅上游 2.7.1 文档收录。 # 【接口变更】 不涉及 # 【功能介绍】 torch.SymFloat.is_integer 是 torch.SymFloat 类的方法(定义于 torch/__init__.py,实际行为由 SymNode驱动)。其功能为:判断符号浮点数是否为整数(Return True if the float is an integer),用于动态形状(dynamic shapes)符号追踪流程。 该 API 为纯 Python 符号逻辑,设备无关,不涉及任何设备侧(CUDA/NPU)计算,也不依赖张量设备。PyTorch 官方社区已有以下直接测试用例(均在 test/dynamo/ 下): - test_functions.py::FunctionTests::test_is_integer(635-642 行)— 编译 fullgraph 下调用 m.is_integer(),覆盖整数值(1.0→走整数分支)与非整数值(1.5→走非整数分支) - test_functions.py::FunctionTests::test_number_method(656-667 行,parametrize 节点 test_number_method_method_is_integer_num_type6)— 通过 getattr(m, "is_integer")() 调用,入参覆盖边界 (0, 1, 2.5) - test_unspec.py::UnspecTests::test_symfloat_no_replacement(677-688 行)— specialize_float=False 下 m 即为 SymFloat,直接调用 m.is_integer() 验证方式及覆盖度: - 入参全覆盖:整数值、非整数值、边界 0/1/2.5,覆盖 int 与 float 类型传入场景 - 设备无关性:测试中张量均为 CPU 张量,无 CUDA/NCCL/CUPTI 依赖 v2.7.1 python -m pytest \ /workspace/user_data/pytorch-v2.7.1/test/dynamo/test_functions.py::FunctionTests::test_is_integer \ /workspace/user_data/pytorch-v2.7.1/test/dynamo/test_functions.py::FunctionTests::test_number_method_method_is_in teger_num_type6 \ /workspace/user_data/pytorch-v2.7.1/test/dynamo/test_unspec.py::UnspecTests::test_symfloat_no_replacement \ -v 运行结果: ======================== test session starts ========================= platform linux -- Python 3.12.13, pytest-8.3.2, pluggy-1.6.0 -- /workspace/envs/torch-npu-test/bin/python cachedir: .pytest_cache rootdir: /workspace/user_data/pytorch-v2.7.1-up configfile: pytest.ini plugins: xdist-3.6.1 collected 3 items Running 3 items in this shard ../workspace/user_data/pytorch-v2.7.1-up/test/dynamo/test_functions.py::FunctionTests::test_is_integer PASSED [0.1360s] [ 33%] ../workspace/user_data/pytorch-v2.7.1-up/test/dynamo/test_functions.py::FunctionTests::test_number_method_method_is_integer_num_type6 PASSED [0.0528s] [ 66%] ../workspace/user_data/pytorch-v2.7.1-up/test/dynamo/test_unspec.py::UnspecTests::test_symfloat_no_replacement PASSED [0.0238s] [100%] ========================= 3 passed in 5.17s ========================== v2.11.0: python -m pytest \ /workspace/user_data/pytorch-v2.11.0/test/dynamo/test_functions.py::FunctionTests::test_is_integer \ /workspace/user_data/pytorch-v2.11.0/test/dynamo/test_functions.py::FunctionTests::test_number_method_method_is_in teger_num_type6 \ /workspace/user_data/pytorch-v2.11.0/test/dynamo/test_unspec.py::UnspecTests::test_symfloat_no_replacement \ -v 运行结果: =========================== test session starts =========================== platform linux -- Python 3.13.14, pytest-9.1.1, pluggy-1.6.0 -- /workspace/envs/torch-py313/bin/python cachedir: .pytest_cache hypothesis profile 'dev' -> database=None, max_examples=10, suppress_health_check=(HealthCheck.too_slow,) rootdir: /workspace/user_data/pytorch-v2.11.0-up configfile: pytest.ini plugins: hypothesis-6.165.2 collected 3 items Running 3 items in this shard ../workspace/user_data/pytorch-v2.11.0-up/test/dynamo/test_functions.py::FunctionTests::test_is_integer PASSED [0.3059s] [ 33%] ../workspace/user_data/pytorch-v2.11.0-up/test/dynamo/test_functions.py::FunctionTests::test_number_method_method_is_integer_num_type6 PASSED [0.0921s] [ 66%] ../workspace/user_data/pytorch-v2.11.0-up/test/dynamo/test_unspec.py::UnspecTests::test_symfloat_no_replacement PASSED [0.0352s] [100%] ============================ 3 passed in 2.90s ============================ v2.12.0: python -m pytest \ /workspace/user_data/pytorch-v2.12.0/test/dynamo/test_functions.py::FunctionTests::test_is_integer \ /workspace/user_data/pytorch-v2.12.0/test/dynamo/test_functions.py::FunctionTests::test_number_method_method_is_in teger_num_type6 \ /workspace/user_data/pytorch-v2.12.0/test/dynamo/test_unspec.py::UnspecTests::test_symfloat_no_replacement \ -v 运行结果: ======================== test session starts ========================= platform linux -- Python 3.13.14, pytest-9.1.1, pluggy-1.6.0 -- /workspace/envs/torch-py313/bin/python cachedir: .pytest_cache hypothesis profile 'dev' -> database=None, max_examples=10, suppress_health_check=(HealthCheck.too_slow,) rootdir: /workspace/user_data/pytorch-v2.12.0-up configfile: pytest.ini plugins: hypothesis-6.165.2 collected 3 items Running 3 items in this shard ../workspace/user_data/pytorch-v2.12.0-up/test/dynamo/test_functions.py::FunctionTests::test_is_integer PASSED [0.2964s] [ 33%] ../workspace/user_data/pytorch-v2.12.0-up/test/dynamo/test_functions.py::FunctionTests::test_number_method_method_is_integer_num_type6 PASSED [0.1004s] [ 66%] ../workspace/user_data/pytorch-v2.12.0-up/test/dynamo/test_unspec.py::UnspecTests::test_symfloat_no_replacement PASSED [0.0361s] [100%] ========================= 3 passed in 2.55s ========================== # 【CheckList】 - [x] 代码注释完备,正确记录错误日志 - [x] PR标题正确使用类型标签:docs - [x] PR持续集成流水线(CI)执行通过 See merge request: Ascend/pytorch!44847 | 3 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 6 天前 | ||
| 3 天前 |