Skip to content

Resolve logger library warnings #1005

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions torchtnt/framework/callbacks/dcp_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _wait(self, log_warning: bool = True) -> None:
computes and logs the time spent waiting on the previous checkpoint to finish, and a toggable warning
for the user to modify checkpointing frequency.

If the previous checkpoing has already finished, this is a no-op.
If the previous checkpoint has already finished, this is a no-op.

Args:
log_warning: Toggle for logging a warning to the user to modify checkpointing frequency. Sometimes
Expand Down Expand Up @@ -323,7 +323,7 @@ def restore_with_id(
Note: If torch.distributed is available and a process group is initialized, dcp assumes the intention is to save/load checkpoints in distributed fashion.
restore_options: Controls what to filter when restoring the state.
knob_options: Additional keyword options for StorageWriter and StorageReader
planner: Instance of LoadPlanner. If this is not specificed, the default planner will be used. (Default: ``None``)
planner: Instance of LoadPlanner. If this is not specified, the default planner will be used. (Default: ``None``)
storage_reader: Instance of StorageReader used to perform reads. If this is not specified, it will automatically infer
the reader based on the checkpoint_id. If checkpoint_id is also None, an exception will be raised. (Default: ``None``)
"""
Expand Down Expand Up @@ -419,7 +419,7 @@ def _maybe_add_dataloader_to_app_state(
ignore_phases.add(phase)

elif not isinstance(dl, Stateful):
logger.warn(
logger.warning(
f"dataloader for {phase} phase was passed to `restore` but it does not implement the Stateful protocol to load states"
)
ignore_phases.add(phase)
Expand Down Expand Up @@ -448,7 +448,7 @@ def _maybe_add_dataloader_to_app_state(
for phase in candidate_dataloaders.keys()
if _PHASE_DL_STATE_KEY_MAPPING[phase] not in app_state
]:
logger.warn(
logger.warning(
f"dataloader ({','.join(str(k) for k in dl_missing_in_ckpt)}) was passed to `restore` "
"but no dataloader exists in checkpoint metadata."
)
Expand Down
4 changes: 2 additions & 2 deletions torchtnt/utils/memory_snapshot_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def start(self) -> None:
if self.is_started:
return
if not torch.cuda.is_available():
logger.warn("CUDA unavailable. Not recording memory history.")
logger.warning("CUDA unavailable. Not recording memory history.")
return

logger.info("Starting to record memory history.")
Expand All @@ -158,7 +158,7 @@ def stop(self) -> None:
if not self.is_started:
return
if not torch.cuda.is_available():
logger.warn("CUDA unavailable. Not recording memory history.")
logger.warning("CUDA unavailable. Not recording memory history.")
return

logger.info("Stopping recording memory history.")
Expand Down