Skip to content

Commit

Permalink
Improve LightGBM Network logs (#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
svotaw committed Nov 6, 2023
1 parent a187cd0 commit 5cd78c9
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ object NetworkManager {
}

private def getNetworkTopologyInfoFromDriver(networkParams: NetworkParams,
taskId: Long,
partitionId: Int,
localListenPort: Int,
log: Logger,
shouldExecuteTraining: Boolean): NetworkTopologyInfo = {
taskId: Long,
partitionId: Int,
localListenPort: Int,
log: Logger,
shouldExecuteTraining: Boolean): NetworkTopologyInfo = {
using(new Socket(networkParams.ipAddress, networkParams.port)) {
driverSocket =>
usingMany(Seq(new BufferedReader(new InputStreamReader(driverSocket.getInputStream)),
Expand Down Expand Up @@ -163,6 +163,12 @@ object NetworkManager {
// and a list of partition ids in this executor.
val lightGbmMachineList = driverInput.readLine()
val partitionsByExecutorStr = driverInput.readLine()
if (partitionsByExecutorStr == null || lightGbmMachineList == null) {
val message = s"Received bad network information. Task $taskId, partition $partitionId received" +
s"partition topology: '$partitionsByExecutorStr', nodes for network init: '$lightGbmMachineList'"
throw new Exception(message)
}

log.info(s"task $taskId, partition $partitionId received partition topology: '$partitionsByExecutorStr'")
log.info(s"task $taskId, partition $partitionId received nodes for network init: '$lightGbmMachineList'")
val executorPartitionIds: Array[Int] =
Expand Down

0 comments on commit 5cd78c9

Please sign in to comment.