-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[NewExe] Performance optimization for program interpreter #58645
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -313,5 +313,47 @@ void Instruction::AddInplace(Variable* in, Variable* out) { | |||
|
|||
void Instruction::ClearInplace() { vec_inplace_in_to_out_.clear(); } | |||
|
|||
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) | |||
void Instruction::UpdataRecordStreamForGcInfo() { | |||
bool is_interpreter_fast_gc_enabled = |
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.
这里为什么不直接调用IsInterpretercoreFastGCEnabled,而要把相关的判断逻辑代码拷贝一份?
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.
考虑到这个函数只是两个 flags 的判断,为了减少一个函数的调度,就直接在这里拷贝了一份逻辑
// record stream for gc | ||
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) | ||
bool need_record_stream_for_gc_ = false; | ||
gpuStream_t record_stream_for_gc_; |
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.
record_stream_for_gc_
命名比较拗口,且和函数名RecordStreamForGC
容易混淆。这里需要存储在Instruction中的本质上是分配给该OP的运行stream,可否直接命名为stream
?另外建议将其初始化为空。
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.
done,tks
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
…le#58645) * fix * refine * refine * fix * fix * fix * fix
…le#58645) * fix * refine * refine * fix * fix * fix * fix
…le#58645) * fix * refine * refine * fix * fix * fix * fix
…le#58645) * fix * refine * refine * fix * fix * fix * fix
PR types
Performance optimization
PR changes
Others
Description
Performance optimization for program interpreter:静态化 CheckGC 的部分逻辑
Pcard-67164