FlatMap seems to have poorer performance than absl::flat_hash_map. Replacing its

use with the latter since lookups / deletions from the rendezvous table block globally.

PiperOrigin-RevId: 306252615
Change-Id: I07e4402436ca75801804a578e3253ab5ff4ab762
This commit is contained in:
A. Unique TensorFlower 2020-04-13 09:58:18 -07:00 committed by TensorFlower Gardener
parent 8c3ac49d24
commit b1fe37760f
2 changed files with 4 additions and 3 deletions

View File

@ -409,6 +409,7 @@ cc_library(
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"@com_google_absl//absl/container:flat_hash_map",
],
)

View File

@ -17,16 +17,16 @@ limitations under the License.
#define TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_BASE_RENDEZVOUS_MGR_H_
#include <string>
#include <unordered_map>
#include <unordered_set>
#include "absl/container/flat_hash_map.h"
#include "tensorflow/core/distributed_runtime/rendezvous_mgr_interface.h"
#include "tensorflow/core/distributed_runtime/worker_env.h"
#include "tensorflow/core/distributed_runtime/worker_session.h"
#include "tensorflow/core/framework/control_flow.h"
#include "tensorflow/core/framework/rendezvous.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/gtl/flatmap.h"
#include "tensorflow/core/lib/gtl/flatset.h"
#include "tensorflow/core/lib/hash/hash.h"
#include "tensorflow/core/platform/macros.h"
#include "tensorflow/core/platform/mutex.h"
@ -97,7 +97,7 @@ class BaseRendezvousMgr : public RendezvousMgrInterface {
private:
// Maps step_id to rendezvous.
typedef gtl::FlatMap<int64, BaseRemoteRendezvous*> Table;
typedef absl::flat_hash_map<int64, BaseRemoteRendezvous*> Table;
// Not owned.
const WorkerEnv* const worker_env_;