diff --git a/tf_adapter/kernels/geop_npu.cc b/tf_adapter/kernels/geop_npu.cc index 3f7ebb81c7801da37d0416c7b6e8e6a1f6e81eb4..55b90264dd860c053b2a89e3c1db4f1caf7ea3fe 100644 --- a/tf_adapter/kernels/geop_npu.cc +++ b/tf_adapter/kernels/geop_npu.cc @@ -328,6 +328,9 @@ void GeOp::Initialize(OpKernelConstruction *ctx) { ctx->GetAttr("_graph_parallel_option_path", &graph_parallel_option_path_); ctx->GetAttr("_recompute_mode", &recompute_mode_); ctx->GetAttr("_dynamic_input", &dynamic_input_); + string jit_compile; + ctx->GetAttr("_jit_compile", &jit_compile); + jit_compile_ = jit_compile == "1" ? true : false; if (!dynamic_input_.empty() && dynamic_input_ == "1") { jit_compile_ = true; is_getnext_dynamic_shape_ = true; @@ -724,7 +727,8 @@ void GeOp::ComputeAsync(OpKernelContext *ctx, DoneCallback done) { // if input shapes changed, cache graphs uint32_t cache_graph_id = graph_id_; bool is_tuning = (!init_options_["ge.jobType"].empty()) && (!init_options_["ge.tuningPath"].empty()); - bool is_lazy_recompile_mode = (dynamic_input_ == "1") && (dynamic_graph_execute_mode_ == "lazy_recompile"); + bool is_lazy_recompile_mode = ((dynamic_input_ == "1") && (dynamic_graph_execute_mode_ == "lazy_recompile")) + || ((dynamic_input_ == "0") && jit_compile_); ADP_LOG(INFO) << "is_set_dynamic_config: " << is_set_dynamic_config << " is_tuning: " << is_tuning << " is_lazy_recompile_mode: " << is_lazy_recompile_mode;