Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RankFilter to skip logging when the rank is not meeting criteria #6243

Merged
merged 6 commits into from
Mar 28, 2023

Conversation

mingxin-zheng
Copy link
Contributor

@mingxin-zheng mingxin-zheng commented Mar 27, 2023

Partially fixes #6189
Fixes #6230

Description

The RankFilter class is a convenient filter that extends the Filter class in the Python logging module.
The purpose is to control which log records are processed based on the rank in a distributed environment.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

…ified criteria

Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
@mingxin-zheng mingxin-zheng marked this pull request as draft March 27, 2023 14:28
monai/utils/dist.py Outdated Show resolved Hide resolved
monai/utils/dist.py Outdated Show resolved Hide resolved
Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
monai/utils/dist.py Outdated Show resolved Hide resolved
mingxin-zheng and others added 3 commits March 28, 2023 06:44
Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
Copy link
Member

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks, it looks good to me

@wyli
Copy link
Member

wyli commented Mar 28, 2023

/build

@mingxin-zheng mingxin-zheng changed the title [WIP] Add RankFilter to skip logging when the rank is not meeting criteria Add RankFilter to skip logging when the rank is not meeting criteria Mar 28, 2023
@mingxin-zheng mingxin-zheng marked this pull request as ready for review March 28, 2023 07:42
@wyli wyli enabled auto-merge (squash) March 28, 2023 08:20
@wyli wyli merged commit be3d138 into Project-MONAI:dev Mar 28, 2023
25 of 30 checks passed
jak0bw pushed a commit to jak0bw/MONAI that referenced this pull request Mar 28, 2023
…roject-MONAI#6243)

Partially fixes Project-MONAI#6189 
Fixes Project-MONAI#6230 

### Description

The RankFilter class is a convenient filter that extends the Filter
class in the Python logging module.
The purpose is to control which log records are processed based on the
rank in a distributed environment.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
jak0bw pushed a commit to jak0bw/MONAI that referenced this pull request Mar 28, 2023
…roject-MONAI#6243)

Partially fixes Project-MONAI#6189 
Fixes Project-MONAI#6230 

### Description

The RankFilter class is a convenient filter that extends the Filter
class in the Python logging module.
The purpose is to control which log records are processed based on the
rank in a distributed environment.

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@mingxin-zheng mingxin-zheng deleted the fea-6230-rank branch April 12, 2023 09:56
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.

optionally skip logging when rank >0 Optimize log printing to be more informative in showing the progress
2 participants