Skip to content

[feat] Add RankFilter#14

Merged
adil-a merged 10 commits intomainfrom
akoumparouli/rank0_logging
Jun 9, 2025
Merged

[feat] Add RankFilter#14
adil-a merged 10 commits intomainfrom
akoumparouli/rank0_logging

Conversation

@akoumpa
Copy link
Copy Markdown
Contributor

@akoumpa akoumpa commented May 28, 2025

Instead of having the following

if rank == 0:
   print / log

this PR adds a RankFilter that's used inside logging, and therefore the code now looks like

logging.info()

internally, logging will apply the RankFilter and will only log from rank 0. If necessary, the user can pass the all_ranks attribute to get a log from all ranks.

As a result, calls to print should be avoided in favor of logging.info

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 28, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@akoumpa akoumpa changed the title fix Add rank0 logger May 28, 2025
@akoumpa akoumpa force-pushed the akoumparouli/rank0_logging branch from 81a59dc to e27ee79 Compare June 6, 2025 21:13
@akoumpa akoumpa changed the title Add rank0 logger [feat] Add RankFilter Jun 6, 2025
@akoumpa akoumpa marked this pull request as ready for review June 6, 2025 21:59
@akoumpa
Copy link
Copy Markdown
Contributor Author

akoumpa commented Jun 6, 2025

/ok to test f7be862

akoumpa added 8 commits June 6, 2025 15:01
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa akoumpa force-pushed the akoumparouli/rank0_logging branch from bac4fe5 to 5a59195 Compare June 6, 2025 22:02
@akoumpa
Copy link
Copy Markdown
Contributor Author

akoumpa commented Jun 6, 2025

/ok to test 5a59195

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa
Copy link
Copy Markdown
Contributor Author

akoumpa commented Jun 6, 2025

/ok to test 6295aec

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
@akoumpa
Copy link
Copy Markdown
Contributor Author

akoumpa commented Jun 7, 2025

/ok to test 118a9de

Copy link
Copy Markdown
Collaborator

@adil-a adil-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adil-a adil-a merged commit 5847331 into main Jun 9, 2025
9 checks passed
@adil-a adil-a deleted the akoumparouli/rank0_logging branch June 9, 2025 15:13
torsli pushed a commit that referenced this pull request Jun 10, 2025
* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add RankFilter

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add docstring

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* rename env var

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* switch from print to logging

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* fix

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* add peak memory

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

* disable logging in ranks > 0

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>

---------

Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants