未验证 提交 ec21bf98 编写于 作者: L Leo Chen 提交者: GitHub

make enable_program_desc_tracing_ thread_local (#39776)

上级 38f87238
......@@ -32,6 +32,8 @@ DECLARE_string(tracer_mkldnn_ops_off);
namespace paddle {
namespace imperative {
thread_local bool Tracer::enable_program_desc_tracing_ = false;
thread_local bool Tracer::has_grad_ = true;
thread_local AmpLevel Tracer::amp_level_ = AmpLevel::O0;
......
......@@ -160,10 +160,11 @@ class Tracer {
private:
std::unique_ptr<BasicEngine> basic_engine_;
std::unique_ptr<jit::ProgramDescTracer> program_desc_tracer_;
bool enable_program_desc_tracing_{false};
std::unique_ptr<UniqueNameGenerator> generator_;
platform::Place expected_place_;
GarbageCollectorMap gcs_;
static thread_local bool enable_program_desc_tracing_;
static thread_local bool has_grad_;
static thread_local AmpLevel amp_level_;
static thread_local phi::DataType amp_dtype_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册