Skip to content

Commit b8d33b3

Browse files
Automated Code Change
PiperOrigin-RevId: 849601638
1 parent 8753633 commit b8d33b3

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

tensorflow/core/tpu/kernels/tpu_compilation_cache_entry_unloader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class TpuCompilationCacheEntryUnloader : public ResourceBase {
4040
}
4141

4242
~TpuCompilationCacheEntryUnloader() override {
43-
absl::MutexLock lock(&mu_);
43+
absl::MutexLock lock(mu_);
4444
for (int64_t uid : cache_entry_uids_) {
4545
absl::Status s = cache_->MarkEntryForEviction(uid);
4646
if (!s.ok()) {
@@ -55,7 +55,7 @@ class TpuCompilationCacheEntryUnloader : public ResourceBase {
5555

5656
// Add cache entry uid to be unloaded in destructor.
5757
void AddCacheEntryUid(int64_t uid) {
58-
absl::MutexLock lock(&mu_);
58+
absl::MutexLock lock(mu_);
5959
cache_entry_uids_.insert(uid);
6060
}
6161

tensorflow/core/tpu/kernels/tpu_compilation_cache_interface.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ absl::Status TpuCompilationCacheInterface::MarkEntryForEviction(
153153
/*level=*/2);
154154
CompiledSubgraph* deleted_entry = nullptr;
155155
{
156-
absl::MutexLock lock(&mu_);
156+
absl::MutexLock lock(mu_);
157157
auto iter = entries_by_uid_.find(subgraph_uid);
158158
if (iter == entries_by_uid_.end()) {
159159
// If already evicted, return ok.
@@ -201,7 +201,7 @@ absl::Status TpuCompilationCacheInterface::Release(int64_t subgraph_uid) {
201201

202202
CompiledSubgraph* deleted_entry = nullptr;
203203
{
204-
absl::MutexLock lock(&mu_);
204+
absl::MutexLock lock(mu_);
205205
auto iter = entries_by_uid_.find(subgraph_uid);
206206

207207
if (iter == entries_by_uid_.end()) {
@@ -291,7 +291,7 @@ void TpuCompilationCacheInterface::DiscardEntryRefs(
291291
absl::Span<CompiledSubgraph* const> entries) {
292292
std::vector<CompiledSubgraph*> removed_entries;
293293
{
294-
absl::MutexLock lock(&mu_);
294+
absl::MutexLock lock(mu_);
295295

296296
for (auto entry : entries) {
297297
removed_entries.push_back(DiscardEntryRef(entry));
@@ -424,7 +424,7 @@ absl::Status TpuCompilationCacheInterface::CompileIfKeyAbsentHelper(
424424

425425
// NOTE: In spite of the fact that we use MutexLock, we do not hold the lock
426426
// for the lifetime of the object, see InitializeEntry() call below.
427-
absl::MutexLock lock(&mu_);
427+
absl::MutexLock lock(mu_);
428428

429429
std::string cache_key = FindCacheKey(subgraph_key);
430430
auto iter = cache_.find(cache_key);
@@ -556,7 +556,7 @@ absl::Status TpuCompilationCacheInterface::GetKeysFromUid(
556556
int64_t uid, std::vector<std::string>* keys) {
557557
keys->clear();
558558

559-
absl::MutexLock lock(&mu_);
559+
absl::MutexLock lock(mu_);
560560
const auto iter = entries_by_uid_.find(uid);
561561
if (iter == entries_by_uid_.end()) {
562562
return errors::NotFound("No subgraph found for uid ", uid);
@@ -574,7 +574,7 @@ absl::Status TpuCompilationCacheInterface::Lookup(
574574
"TPU compilation cache proto lookup by uid",
575575
/*level=*/2);
576576

577-
absl::MutexLock lock(&mu_);
577+
absl::MutexLock lock(mu_);
578578
const auto iter = entries_by_uid_.find(uid);
579579
if (iter == entries_by_uid_.end()) {
580580
return errors::NotFound("No subgraph found for uid ", uid);
@@ -599,7 +599,7 @@ absl::Status TpuCompilationCacheInterface::Lookup(
599599
"TPU compilation cache proto lookup",
600600
/*level=*/2);
601601

602-
absl::MutexLock lock(&mu_);
602+
absl::MutexLock lock(mu_);
603603
const auto iter = entries_by_proto_key_.find(proto_key);
604604
if (iter == entries_by_proto_key_.end()) {
605605
return errors::NotFound("No proto found for key ", proto_key);

tensorflow/core/tpu/kernels/tpu_compilation_cache_rpc_lookup.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ absl::Status TpuCompilationCacheRpcLookup::Lookup(
8181
proto_key, "_", tpu::CompilationCacheFetchTarget_Name(fetch_target));
8282

8383
{
84-
absl::MutexLock lock(&mu_);
84+
absl::MutexLock lock(mu_);
8585
auto iter = cache_.find(local_proto_key);
8686
if (iter == cache_.end()) {
8787
tpu::GetTpuProgramRequest request;
@@ -123,7 +123,7 @@ absl::Status TpuCompilationCacheRpcLookup::Lookup(
123123
absl::StrCat(" _ ", uid, ":", proto_index, "_",
124124
tpu::CompilationCacheFetchTarget_Name(fetch_target));
125125
{
126-
absl::MutexLock lock(&mu_);
126+
absl::MutexLock lock(mu_);
127127
auto iter = cache_.find(local_proto_key);
128128
if (iter == cache_.end()) {
129129
tpu::GetTpuProgramRequest request;

tensorflow/core/tpu/kernels/tpu_fingerprint_lookup.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ TpuFingerprintLookup* TpuFingerprintLookup::Create() {
2626

2727
void TpuFingerprintLookup::RegisterKeyAndIntermediatePair(uint64 key,
2828
uint64 intermediate) {
29-
absl::MutexLock lock(&mu_);
29+
absl::MutexLock lock(mu_);
3030
auto [it, emplaced] = intermediate_to_key_.try_emplace(intermediate, key);
3131
if (it->second != key) {
3232
VLOG(2) << "The key (" << it->second
@@ -37,7 +37,7 @@ void TpuFingerprintLookup::RegisterKeyAndIntermediatePair(uint64 key,
3737

3838
bool TpuFingerprintLookup::RegisterIntermediateAndValuePair(uint64 intermediate,
3939
std::string value) {
40-
absl::MutexLock lock(&mu_);
40+
absl::MutexLock lock(mu_);
4141
auto it = intermediate_to_key_.find(intermediate);
4242
if (it == intermediate_to_key_.end()) {
4343
VLOG(2) << "Cannot find the intermediate ( " << intermediate
@@ -83,7 +83,7 @@ bool TpuFingerprintLookup::RegisterIntermediateAndValuePair(uint64 intermediate,
8383
}
8484

8585
std::optional<absl::string_view> TpuFingerprintLookup::Lookup(uint64 key) {
86-
absl::MutexLock lock(&mu_);
86+
absl::MutexLock lock(mu_);
8787
auto it = key_to_value_.find(key);
8888
if (it == key_to_value_.end()) {
8989
return std::optional<absl::string_view>{};

tensorflow/core/tpu/kernels/tpu_fingerprint_lookup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class TpuFingerprintLookup : public ResourceBase {
6868
std::optional<absl::string_view> Lookup(uint64 key);
6969

7070
size_t num_valid() {
71-
absl::MutexLock lock(&mu_);
71+
absl::MutexLock lock(mu_);
7272
return key_to_value_.size();
7373
}
7474

tensorflow/core/tpu/kernels/tpu_functional_ops.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ void TPUPartitionedCallOp::ComputeAsync(OpKernelContext* ctx,
12631263
bool enable_spmd_xla_partitioning = false;
12641264
TPUMetadata tpu_metadata;
12651265
{
1266-
absl::MutexLock l(&mu_);
1266+
absl::MutexLock l(mu_);
12671267
// We are not using OP_REQUIRES_OK_ASYNC here as we are inside the
12681268
// call_once. It will be checked later whether `ordinal_selector_` is
12691269
// initialized.
@@ -1301,7 +1301,7 @@ void TPUPartitionedCallOp::ComputeAsync(OpKernelContext* ctx,
13011301
&device_ordinal),
13021302
done);
13031303
uint64_t cache_hash = Hash64Combine(input_hash, device_ordinal);
1304-
absl::ReleasableMutexLock lock(&mu_);
1304+
absl::ReleasableMutexLock lock(mu_);
13051305

13061306
const std::vector<DeviceAndFHandle>* functions;
13071307

0 commit comments

Comments
 (0)