DiamondLightSource / DiamondLightSource/httomo
Redundant logging of GPU ID in data transfer method
- Dominant language
- Python
- Stars
- 10
- Forks
- 5
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 1
Description
The `log_rank()` function is used to log the data being transferred from CPU to GPU memory: https://github.com/DiamondLightSource/httomo/blob/8b3a2a06c596add2ae14e5da3377457acece6e1b/httomo/method_wrappers/generic.py#L366-L370
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)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.