-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
50e2443
to
68cb836
Compare
InitAutoGrowthXPUAllocator(platform::XPUPlace(dev_id), | ||
allow_free_idle_chunk_); | ||
} | ||
if (FLAGS_use_stream_safe_cuda_allocator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xpu也用这个flag吗
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是否可以去掉Tx,少一个模板参数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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)) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议改成XPU_SUCCESS
你的PR已合入Paddle库,请关注后续测试结果。 |
PR types
New features
PR changes
APIs
Description
XPU Paddle support auto-growth allocator
XPU Context delete FLAG for dataloader context