message: Build `node_name_to_cost_id_map_` after graph optimization passes.
  Graph optimization passes might overwrite feed/fetch nodes.
diff: @@ -546,10 +546,6 @@ Status GraphExecutionState::InitBaseGraph(const BuildGraphOptions& options) {
  std::unique_ptr<Graph> new_graph(new Graph(OpRegistry::Global()));
  GraphConstructorOptions opts;
  TF_RETURN_IF_ERROR(ConvertGraphDefToGraph(opts, *graph_def, new_graph.get()));
  - for (const Node* n : new_graph->nodes()) {
  - VLOG(2) << "Mapping " << n->name() << " to " << n->cost_id();
  - node_name_to_cost_id_map_[n->name()] = n->cost_id();
  - }
  if (session_options_ &&
  session_options_->config.graph_options().place_pruned_graph()) {
  // Rewrite the graph before placement.
  @@ -578,6 +574,11 @@ Status GraphExecutionState::InitBaseGraph(const BuildGraphOptions& options) {
  TF_RETURN_IF_ERROR(OptimizationPassRegistry::Global()->RunGrouping(
  OptimizationPassRegistry::POST_PLACEMENT, optimization_options));
  + for (const Node* n : new_graph->nodes()) {
  + VLOG(2) << "Mapping " << n->name() << " to " << n->cost_id();
  + node_name_to_cost_id_map_[n->name()] = n->cost_id();
  + }
  +
  SaveStatefulNodes(new_graph.get());
  graph_ = new_graph.release();
  return Status::OK();
  