Skip to content

Conversation

@DongBaiYue
Copy link
Contributor

@DongBaiYue DongBaiYue commented Oct 28, 2025

PR Category

Performance Optimization

PR Types

New features

Description

支持xpu上的pin_memory相关 API。
使用示例:

# one case
tensor_device = paddle.rand((624, 1024, 1024))
tensor_pin = test_tensor.pin_memory(blocking=True)

# another case
tensor_device = paddle.rand((624, 1024, 1024))
tensor_pin = paddle.empty_like(tensor_device, pin_memory=True)
tensor_pin.copy_(test_tensor, non_blocking=False)

pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Oct 28, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@DongBaiYue
Copy link
Contributor Author

/re-run all-failed

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@f07eb72). Learn more about missing BASE report.

Files with missing lines Patch % Lines
paddle/fluid/imperative/tracer.cc 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #76092   +/-   ##
==========================================
  Coverage           ?   90.00%           
==========================================
  Files              ?        2           
  Lines              ?       10           
  Branches           ?        0           
==========================================
  Hits               ?        9           
  Misses             ?        1           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DongBaiYue
Copy link
Contributor Author

/re-run all-failed

phi::XPUPlace place_src(src_place.GetDeviceId());
return Copy(place_dst, dst, place_src, src, num, stream);
#endif
#ifdef PADDLE_WITH_CUSTOM_DEVICE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥把CustomDevice的逻辑也删除了

Copy link
Contributor Author

@DongBaiYue DongBaiYue Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这部分是无效代码,核心逻辑

#ifdef PADDLE_WITH_CUDA || defined(PADDLE_WITH_HIP)
template <> PADDLE_API void Copy<phi::Place, phi::Place>{
    ……
#ifdef PADDLE_WITH_XPU
    ……
#endif
#ifdef PADDLE_WITH_CUSTOM_DEVICE
    ……
#endif
}
#endif

分支执行不到

Copy link
Contributor

@yongqiangma yongqiangma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yongqiangma yongqiangma merged commit 4074f96 into PaddlePaddle:develop Nov 5, 2025
71 of 73 checks passed
AlAuAu pushed a commit to AlAuAu/Paddle that referenced this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants