Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfeiBai committed Apr 25, 2024
1 parent c5c994a commit 00f54e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torch_xla/csrc/runtime/ifrt_computation_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ std::string IfrtComputationClient::IfrtDeviceToString(
xla::ifrt::Device* const device) const {
std::string platform =
absl::AsciiStrToUpper(device->client()->platform_name());
int ordinal = global_ordinals_.at(device->Id());
int ordinal = global_ordinals_.at(device->Id().value());
std::string str = absl::StrFormat("%s:%d", platform, ordinal);
return str;
}
Expand Down Expand Up @@ -126,9 +126,9 @@ IfrtComputationClient::IfrtComputationClient() {
std::vector<xla::ifrt::Device*> ordered_devices(client_->device_count());
std::partial_sort_copy(client_->devices().begin(), client_->devices().end(),
ordered_devices.begin(), ordered_devices.end(),
[](auto& a, auto& b) { return a->Id() < b->Id(); });
[](auto& a, auto& b) { return a->Id().value() < b->Id().value(); });
for (auto* device : ordered_devices) {
global_ordinals_[device->Id()] = global_ordinals_.size();
global_ordinals_[device->Id().value()] = global_ordinals_.size();
std::string device_str = IfrtDeviceToString(device);
string_to_device_.emplace(device_str, device);
}
Expand Down

0 comments on commit 00f54e0

Please sign in to comment.