Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xpu support auto growth allocator #54121

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

ykkk2333
Copy link
Contributor

@ykkk2333 ykkk2333 commented May 26, 2023

PR types

New features

PR changes

APIs

Description

XPU Paddle support auto-growth allocator
XPU Context delete FLAG for dataloader context

@paddle-bot
Copy link

paddle-bot bot commented May 26, 2023

你的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.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels May 26, 2023
@paddle-bot
Copy link

paddle-bot bot commented May 26, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

InitAutoGrowthXPUAllocator(platform::XPUPlace(dev_id),
allow_free_idle_chunk_);
}
if (FLAGS_use_stream_safe_cuda_allocator) {
Copy link
Contributor

Choose a reason for hiding this comment

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

xpu也用这个flag吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

加flag效果也一样,主要新增flag需要改动flag.cc,程序比较复杂

size_t XPUMinChunkSize() { return 1 << 6; }

static void RaiseNonOutOfMemoryError(int status) {
if (status == -705) {
Copy link
Contributor

Choose a reason for hiding this comment

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

用defs.h里的定义

SetXdlCtx();
xpu::Context* ctx_t = GetXdlCtx();
if (ctx_t) {
PD_CHECK(context_ != nullptr, "the xpu context is nullptr.");
Copy link
Contributor

Choose a reason for hiding this comment

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

这里的string写反了,应该是dataloader线程会进来

}

template <typename Context, typename T, typename Tx>
Tx* Alloc_l3_or_gm(const Context& dev_ctx,
Copy link
Contributor

Choose a reason for hiding this comment

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

是否可以去掉Tx,少一个模板参数

Copy link
Contributor

@ZibinGuo ZibinGuo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@XiaociZhang XiaociZhang left a comment

Choose a reason for hiding this comment

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

LGTM

do { \
auto __cond__ = (COND); \
auto xre_msg = xpu_strerror(__cond__); \
if (UNLIKELY(__cond__ != 0)) { \
Copy link
Contributor

Choose a reason for hiding this comment

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

建议改成XPU_SUCCESS

YuanRisheng
YuanRisheng previously approved these changes Jun 7, 2023
@QingshuChen QingshuChen merged commit 168fac1 into PaddlePaddle:develop Jun 8, 2023
@paddle-bot
Copy link

paddle-bot bot commented Jun 8, 2023

你的PR已合入Paddle库,请关注后续测试结果。
Your PR has been merged into the repository. An official integration test will be conducted later. Stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants