Skip to content

Commit b9b2c19

Browse files
committed
Minor cleanup to Communicator
1 parent 1e53c7c commit b9b2c19

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

csrc/host_ir/evaluator.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@ HostIrEvaluator::HostIrEvaluator(
4646
communicator_(communicator),
4747
params_(params),
4848
expr_evaluator_(),
49-
my_local_device_index_(communicator_ ? communicator_->local_rank() : 0),
49+
my_local_device_index_(
50+
communicator_ == nullptr ? 0 : communicator_->local_rank()),
5051
ipc_handle_cache_(expr_evaluator_),
5152
multicast_handle_cache_() {
5253
const DeviceIdxType device_index =
53-
(communicator_ != nullptr && communicator_->is_available())
54-
? communicator_->deviceId()
55-
: 0;
54+
communicator_ == nullptr ? 0 : communicator_->deviceId();
5655
if (isDebugDumpEnabled(DebugDumpOption::HostIr) && device_index == 0) {
5756
container_->print(debug());
5857
}

csrc/multidevice/communicator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "multidevice/c10d_mock.h"
2020
#endif
2121

22-
#include "exceptions.h"
2322
#include "multidevice/multidevice.h"
2423
#include "visibility.h"
2524

0 commit comments

Comments
 (0)