已合并
[sync] PR-36922: test(npu): add primary context isolation tests #37661
ascend-robot创建于 6月5日
[sync] PR-36922: test(npu): add primary context isolation tests #37661
已合并
ascend-robot创建于 6月5日
ascend-robot
ascend-robot成员
6月5日

1. Origin pull request:

https://gitcode.com/Ascend/pytorch/merge_requests/36922

https://gitcode.com/Ascend/pytorch/issues/2262

Sha Datetime Message
96d3670f 2026-06-04 20:33:43 +0800 CST test: remove debug prints and set ACL_OP_INIT_MODE=1 for CI compatibility

Remove diagnostic debug output from test_npu_primary_ctx.py.
Set ACL_OP_INIT_MODE=1 in main block to prevent eager ACL op
initialization from implicitly creating device 0 primary context,
which is the root cause of CI failure (CI sets ACL_OP_INIT_MODE=0).

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
c1b3d598 2026-06-04 15:17:53 +0800 CST Revert "test: add diagnostic test files for CI primary ctx failure"

This reverts commit eb1e36319452da71fdbedbeec22bb72d3e9fea1b.
78a9c425 2026-06-04 15:17:33 +0800 CST Revert "test: pure ctypes test — only AclrtGetPrimaryCtxState, no torch_npu wrapper"

This reverts commit f0a4f1e267c380ea9d74bc4a42a9354b385c1b80.
f0a4f1e2 2026-06-03 16:55:35 +0800 CST test: pure ctypes test — only AclrtGetPrimaryCtxState, no torch_npu wrapper
eb1e3631 2026-06-03 15:10:00 +0800 CST test: add diagnostic test files for CI primary ctx failure

- test_npu_primary_ctx_swap_order.py: swap hasPrimaryContext(1)/(0) check order
- test_npu_primary_ctx_ctypes.py: ctypes direct call AclrtGetPrimaryCtxState
ba9d8b6c 2026-06-02 14:55:15 +0800 CST test(npu): add primary context isolation tests with debug diagnostics

Add test_npu_primary_ctx.py to verify NPU primary context isolation
across devices, with debug logging for CI environment diagnosis.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 ascend-robot 的贡献)
ascend-robotascend-robot成员
6月5日 创建了 pull request,commit e0d6b801
ascend-robotascend-robot成员
6月5日 关联了issue:[Usage]:补充_npu_hasPrimaryContext接口测试用例
ascend-robotascend-robot成员
6月5日 添加了label:stat/needs-squash
ascend-robotascend-robot成员
6月5日 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
6月5日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here
You can get sig-info at here


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
test liujunzhu, wanglijun55 (2/2) liujunzhu (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

ascend-ds-bot, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
ascend-robot
ascend-robot成员
6月5日 评论:

Ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月5日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月5日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
6月5日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月5日 添加了label:docs-ci-pipeline-success
wuyouqi1
wuyouqi1成员
6月5日 评论:

compile

likedislike
ascend-robot
ascend-robot成员
6月5日 评论:

Ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月5日 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
6月5日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月5日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
6月5日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月5日 添加了label:docs-ci-pipeline-success
wuyouqi1
wuyouqi1成员
6月5日 评论:

compile

likedislike
ascend-robotascend-robot成员
6月5日 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
6月5日 评论:

Ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
6月5日 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
6月5日 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
6月5日 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
6月5日 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
6月5日 添加了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
6月5日 删除了label:ci-pipeline-running
ascend-robotascend-robot成员
6月5日 添加了label:ci-pipeline-passed
ascend-robot
ascend-robot成员
6月5日 评论:
流水线 PR-pipeline_pytorch#29877 已完成
阶段 任务名 状态 详情
编译构建 Build_X86 >>>
Build_ARM >>>
Build_LibTorch_x86 >>>
Build_LibTorch_ARM >>>
Build_X86_torchair 🛑 >>>
Build_ARM_torchair 🛑 >>>
patch_test 🛑 >>>
恶意代码检查 Antipoison >>>
编码安全与规范检查 CodeCheck >>>
check_error >>>
CodeCheck_lintrunner >>>
开源片段检查 SCA >>>
开发者测试 UT_X86_Part_01 🛑 >>>
UT_X86_Part_02 🛑 >>>
UT_ARM_A3_Part_01 🛑 >>>
UT_ARM_A3_Part_02 🛑 >>>
UT_ARM_A2_Part_01 >>>
UT_ARM_A2_Part_02 >>>
UT_ARM_A2_Part_03 >>>
UT_inductor_Part_01 🛑 >>>
UT_inductor_Part_02 🛑 >>>
UT_inductor_Part_03 🛑 >>>
UT_inductor_Part_04 🛑 >>>
UT_DIST_ARM_Part_01 >>>
UT_DIST_ARM_Part_02 >>>
UT_DIST_ARM_Part_03 >>>
UT_DIST_ARM_Part_04 >>>
UT_ARM_A2_Select_Part_01 >>>
UT_ARM_A2_Select_Part_02 >>>
流水线 PR-pipeline_pytorch >>>
likedislike
wanglijun55成员
6月5日 评论:

/lgtm

likedislike
liujunzhu
liujunzhu成员
6月5日 评论:

/approve

likedislike
ascend-robotascend-robot成员
6月5日 添加了label:approvedlgtm
ascend-robotascend-robot成员
6月5日 合入了pull request
ascend-robot
ascend-robot成员
6月5日 评论:
流水线 pytorch_gitcode_PR_multiVersion#10040 [ commitID:f0fd59c8 ] 已完成
likedislike