未验证 提交 32e977c5 编写于 作者: J jiangcheng 提交者: GitHub

[CINN] fix inplace internal var cannot found in scope when only input fused bug (#50204)

上级 6d70761e
......@@ -235,6 +235,9 @@ std::unordered_set<std::string> CinnLaunchContext::ExtractInternalVarNames(
remain_var_names.erase(var_name + InplaceOutSuffix);
}
};
VLOG(1) << "Input var list: " << string::join_strings(input_var_names, ", ");
VLOG(1) << "Ouput var list: " << string::join_strings(output_var_names, ", ");
std::for_each(
input_var_names.begin(), input_var_names.end(), exclude_names_fn);
std::for_each(
......@@ -474,6 +477,8 @@ framework::InterpreterCore* CinnLaunchContext::InitializeInterpreterCore(
"interpreter_core_: "
<< interpreter_core_.get() << "; scope: " << scope
<< "; cached_scope_: " << cached_scope_;
VLOG(1) << "Internal var list: "
<< string::join_strings(internal_var_names_, ", ");
for (auto&& var_name : internal_var_names_) {
auto* var = scope->FindVar(var_name);
if (var != nullptr) {
......@@ -506,8 +511,7 @@ std::string CinnLaunchContext::RedirectVarName(const std::string& var_name) {
}
std::string remove_suffix_name = var_name.substr(0, pos);
if (!inplace_var_names_.count(remove_suffix_name)) {
LOG(WARNING) << "Variable:" << remove_suffix_name
<< " was not marked as inplaced by Paddle, but CINN does";
return var_name;
}
VLOG(4) << "Inplaced variable:" << var_name << " redirect to "
<< remove_suffix_name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册