Internal fixes for TPU compile cache misses.

PiperOrigin-RevId: 270730175
This commit is contained in:
A. Unique TensorFlower 2019-09-23 12:06:08 -07:00 committed by TensorFlower Gardener
parent 0949d6a59a
commit 9d2fe33fad
2 changed files with 4 additions and 8 deletions

View File

@ -734,12 +734,10 @@ Status Conditional::BuildIfNode(Graph* graph,
const string branch_name[] = {"else_branch", "then_branch"};
for (auto branch : {BranchType::kElseBranch, BranchType::kThenBranch}) {
int branch_index = static_cast<int>(branch);
static std::atomic<int64> sequence_num(0LL);
int64 id = ++sequence_num;
NameAttrList body_name;
body_name.set_name(
absl::StrCat("_functionalize_if_", branch_name[branch_index], "_", id));
body_name.set_name(library->UniqueFunctionName(
absl::StrCat("_functionalize_if_", branch_name[branch_index], "_")));
VLOG(3) << "FunctionalizeControlFlow (" << branch_name[branch_index]
<< "): "

View File

@ -413,12 +413,10 @@ Status FunctionalizeLoop(Graph* graph, WhileLoopFrame* frame,
<< DumpGraphToFile("loop_condition", *cond_graph, library)
<< " body: " << DumpGraphToFile("loop_body", *body_graph);
static std::atomic<int64> sequence_num(0LL);
int64 id = ++sequence_num;
NameAttrList cond_name;
cond_name.set_name(absl::StrCat("_functionalize_cond_", id));
cond_name.set_name(library->UniqueFunctionName("_functionalize_cond_"));
NameAttrList body_name;
body_name.set_name(absl::StrCat("_functionalize_body_", id));
body_name.set_name(library->UniqueFunctionName("_functionalize_body_"));
FunctionDef cond_fdef;
TF_RETURN_IF_ERROR(
GraphToFunctionDef(*cond_graph, cond_name.name(), &cond_fdef));