Skip to content

Redundant logging of GPU ID in data transfer method #658

Description

@yousefmoazzam

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    loggingminorNice to do but not vital

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions