-
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
add gc for multi jobs #54897
add gc for multi jobs #54897
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
std::set<std::string> skip_vars = job->SkipGcVars(); | ||
execution_config.skip_gc_vars = | ||
std::set<std::string>(skip_vars.begin(), skip_vars.end()); |
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.
std::set<std::string> skip_vars = job->SkipGcVars(); | |
execution_config.skip_gc_vars = | |
std::set<std::string>(skip_vars.begin(), skip_vars.end()); | |
execution_config.skip_gc_vars = job->SkipGcVars(); |
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.
@@ -59,11 +59,10 @@ StandaloneExecutor::StandaloneExecutor(const platform::Place& place, | |||
|
|||
interpreter::ExecutionConfig execution_config; | |||
execution_config.create_local_scope = false; | |||
// TODO(Ruibiao): hack skip gc all vars for multiple jobs, improve it later | |||
if (jobs.size() > 1) { |
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.
这个if
判断可以直接删除
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.
op_info = OpInOutInfo(op) | ||
op_info.build_op_info() | ||
|
||
for in_name in op.input_arg_names: |
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.
除了输入var,输出var也应该被处理。
建议在step1中直接预处理每个program的{input_arg_names} + {output_arg_names} - {no_needed_names}
集合作为vars_list供step2和step3使用。
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.
for op in program.global_block().ops: | ||
op_info = OpInOutInfo() | ||
for in_name in op.input_arg_names: | ||
if not var_can_be_deleted(in_name, program): | ||
continue | ||
|
||
if not op_info.is_build: | ||
op_info.build_info(op) | ||
|
||
if op_info.is_needed(in_name): | ||
vars_list[ip].add(in_name) | ||
|
||
for out_name in op.output_arg_names: | ||
if var_can_be_deleted(out_name, program): | ||
vars_list[ip].add(out_name) |
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.
for op in program.global_block().ops: | |
op_info = OpInOutInfo() | |
for in_name in op.input_arg_names: | |
if not var_can_be_deleted(in_name, program): | |
continue | |
if not op_info.is_build: | |
op_info.build_info(op) | |
if op_info.is_needed(in_name): | |
vars_list[ip].add(in_name) | |
for out_name in op.output_arg_names: | |
if var_can_be_deleted(out_name, program): | |
vars_list[ip].add(out_name) | |
for op in program.global_block().ops: | |
op_info = OpInOutInfo() | |
op_info.build_info(op) | |
for var_name in op.input_arg_names + op.output_arg_names : | |
if op_info.is_needed(var_name) and var_can_be_deleted(var_name, program): | |
vars_list[ip].add(var_name) |
PR types
Others
PR changes
Others
Description
PCard-71568