The log_rank() function is used to log the data being transferred from CPU to GPU memory:
|
gpulog_str = ( |
|
f"Using GPU {self._gpu_id} to transfer data of shape {xp.shape(block.data)}, " |
|
f"{self.method_name} ({self.package_name})" |
|
) |
|
log_rank(gpulog_str, comm=self.comm) |
in which the GPU ID is included.
However, the log_rank() function is already designed to include the process rank (which is the same as the GPU ID), which leads to duplicated information in the debug logs:
2025-12-04 22:41:14.491 | DEBUG | httomo.utils:log_rank:75 - RANK: [0], Using GPU 0 to transfer data of shape (1801, 33, 1970), remove_all_stripe (httomolibgpu)
2025-12-04 22:41:16.023 | DEBUG | httomo.utils:log_rank:75 - RANK: [0], Using GPU 0 to transfer data of shape (1801, 33, 1970), data_checker (httomolibgpu)
2025-12-04 22:41:16.051 | DEBUG | httomo.utils:log_rank:75 - RANK: [0], Using GPU 0 to transfer data of shape (1801, 33, 1970), LPRec3d_tomobar (httomolibgpu)
2025-12-04 22:41:16.125 | DEBUG | httomo.utils:log_rank:75 - RANK: [2], Using GPU 2 to transfer data of shape (1801, 34, 1970), data_checker (httomolibgpu)
2025-12-04 22:41:16.126 | DEBUG | httomo.utils:log_rank:75 - RANK: [3], Using GPU 3 to transfer data of shape (1801, 34, 1970), data_checker (httomolibgpu)
2025-12-04 22:41:16.129 | DEBUG | httomo.utils:log_rank:75 - RANK: [1], Using GPU 1 to transfer data of shape (1801, 34, 1970), data_checker (httomolibgpu)
2025-12-04 22:41:16.155 | DEBUG | httomo.utils:log_rank:75 - RANK: [3], Using GPU 3 to transfer data of shape (1801, 34, 1970), LPRec3d_tomobar (httomolibgpu)
2025-12-04 22:41:16.155 | DEBUG | httomo.utils:log_rank:75 - RANK: [2], Using GPU 2 to transfer data of shape (1801, 34, 1970), LPRec3d_tomobar (httomolibgpu)
2025-12-04 22:41:16.159 | DEBUG | httomo.utils:log_rank:75 - RANK: [1], Using GPU 1 to transfer data of shape (1801, 34, 1970), LPRec3d_tomobar (httomolibgpu)
where there's duplication between the rank and GPU ID:
RANK: [0], Using GPU 0 to transfer data of shape (1801, 33, 1970), remove_all_stripe (httomolibgpu)
It's not a big deal, but makes the logs noisier than they need to be.
One suggestion would be to remove the GPU ID and have the format be something like the following:
RANK: [0], Transferring data of shape (1801, 33, 1970), remove_all_stripe (httomolibgpu)
The
log_rank()function is used to log the data being transferred from CPU to GPU memory:httomo/httomo/method_wrappers/generic.py
Lines 366 to 370 in 8b3a2a0
in which the GPU ID is included.
However, the
log_rank()function is already designed to include the process rank (which is the same as the GPU ID), which leads to duplicated information in the debug logs:where there's duplication between the rank and GPU ID:
It's not a big deal, but makes the logs noisier than they need to be.
One suggestion would be to remove the GPU ID and have the format be something like the following: