Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfeiBai committed Apr 25, 2024
1 parent 52d8ebd commit e3fe214
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions torch_xla/csrc/runtime/ifrt_computation_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ IfrtComputationClient::IfrtComputationClient() {
// a device's global ordinal separately from its device ID. Order the
// devices by increasing ID to assign global ordinals.
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().value() < b->Id().value(); });
std::partial_sort_copy(
client_->devices().begin(), client_->devices().end(),
ordered_devices.begin(), ordered_devices.end(),
[](auto& a, auto& b) { return a->Id().value() < b->Id().value(); });
for (auto* device : ordered_devices) {
global_ordinals_[device->Id().value()] = global_ordinals_.size();
std::string device_str = IfrtDeviceToString(device);
Expand Down

0 comments on commit e3fe214

Please sign in to comment.