From b4a149a59e70826bd24a99f5d6de5f8b18df69bf Mon Sep 17 00:00:00 2001 From: hong <43953930+phlrain@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:19:16 +0800 Subject: [PATCH] posh code (#55114) --- paddle/fluid/framework/new_executor/standalone_executor.cc | 1 + paddle/fluid/ir/phi_kernel_adaptor/phi_kernel_util.h | 6 ------ paddle/fluid/ir/transforms/pd_op_to_kernel_pass.cc | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/framework/new_executor/standalone_executor.cc b/paddle/fluid/framework/new_executor/standalone_executor.cc index 24931a15e12..1976f8433d0 100644 --- a/paddle/fluid/framework/new_executor/standalone_executor.cc +++ b/paddle/fluid/framework/new_executor/standalone_executor.cc @@ -61,6 +61,7 @@ StandaloneExecutor::StandaloneExecutor(const platform::Place& place, execution_config.create_local_scope = false; execution_config.skip_gc_vars = job->SkipGcVars(); + // TODO(phlrain) we only support cpu for now if (FLAGS_enable_new_ir_in_executor && platform::is_cpu_place(place)) { VLOG(6) << "begin to translate" << std::endl; auto base_program = paddle::TranslateLegacyProgramToProgram(*program); diff --git a/paddle/fluid/ir/phi_kernel_adaptor/phi_kernel_util.h b/paddle/fluid/ir/phi_kernel_adaptor/phi_kernel_util.h index 98fff8ede3e..8a8efae7473 100644 --- a/paddle/fluid/ir/phi_kernel_adaptor/phi_kernel_util.h +++ b/paddle/fluid/ir/phi_kernel_adaptor/phi_kernel_util.h @@ -187,9 +187,7 @@ void BuildPhiContext( } ctx->EmplaceBackAttr(vec_res); } else if (attr_type_name == "ir::ArrayAttribute") { - std::cerr << "int64 array" << std::endl; auto array_list = attr_map[t].dyn_cast().data(); - std::cerr << "len " << array_list.size() << std::endl; std::vector vec_res; if (array_list.size() > 0) { @@ -198,12 +196,8 @@ void BuildPhiContext( true, phi::errors::PreconditionNotMet( "Element in array list MUST be ir::Int64Attribute ")); - std::cerr << "int 64" << std::endl; for (size_t i = 0; i < array_list.size(); ++i) { - std::cerr << "i " << i << "\t" - << array_list[i].dyn_cast().data() - << std::endl; vec_res.push_back( array_list[i].dyn_cast().data()); } diff --git a/paddle/fluid/ir/transforms/pd_op_to_kernel_pass.cc b/paddle/fluid/ir/transforms/pd_op_to_kernel_pass.cc index ef3d499389e..e5471e0d873 100644 --- a/paddle/fluid/ir/transforms/pd_op_to_kernel_pass.cc +++ b/paddle/fluid/ir/transforms/pd_op_to_kernel_pass.cc @@ -132,6 +132,7 @@ phi::KernelKey GetKernelKey( } auto input_tmp = op->operand(i); + // NOTE: if not input_tmp, it's an optional input if (!input_tmp) { continue; } -- GitLab