Skip to content
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
6 changes: 6 additions & 0 deletions deepspeed/runtime/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ def get_dataloader_drop_last(param_dict):
return get_scalar_param(param_dict, DATALOADER_DROP_LAST, DATALOADER_DROP_LAST_DEFAULT)


def get_log_level(param_dict):
return get_scalar_param(param_dict, LOG_LEVEL, LOG_LEVEL_DEFAULT)


'''Write deepspeed config files by modifying basic templates.
Can be used for quickly changing parameters via command line parameters.'''

Expand Down Expand Up @@ -868,6 +872,8 @@ def _initialize_params(self, param_dict):

self.dataloader_drop_last = get_dataloader_drop_last(param_dict)

self.log_level = get_log_level(param_dict)

self.nebula_config = DeepSpeedNebulaConfig(param_dict)
self.datastates_config = DeepSpeedDataStatesConfig(param_dict)
self.checkpoint_config = get_checkpoint_config(param_dict)
Expand Down
3 changes: 3 additions & 0 deletions deepspeed/runtime/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,3 +501,6 @@ class ValidationMode:
#########################################
USE_DATA_BEFORE_EXPERT_PARALLEL = "use_data_before_expert_parallelism"
USE_DATA_BEFORE_EXPERT_PARALLEL_DEFAULT = False

LOG_LEVEL = "log_level"
LOG_LEVEL_DEFAULT = "WARNING"
6 changes: 5 additions & 1 deletion deepspeed/runtime/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
from ..git_version_info import version

from deepspeed.profiling.flops_profiler.profiler import FlopsProfiler
from deepspeed.utils.logging import print_json_dist, print_configuration
from deepspeed.utils.logging import print_json_dist, print_configuration, set_log_level_from_string

from deepspeed.accelerator import get_accelerator

Expand Down Expand Up @@ -277,6 +277,7 @@ def __init__(self,
self._do_args_sanity_check(args)
self._configure_with_arguments(args, mpu)
self._do_sanity_check()
set_log_level_from_string(self.log_level())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Respect launcher log-level overrides

In launcher runs, deepspeed/launcher/runner.py:574 forwards --log_level and deepspeed/launcher/launch.py:151 applies it before the user script starts, but configs that omit the new key now reach this line with LOG_LEVEL_DEFAULT = "WARNING". That silently downgrades explicit --log_level debug/info and also weakens --quiet/error back to warnings during engine construction unless users duplicate the setting in ds_config.json, so the existing CLI verbosity control no longer works for ordinary launcher invocations. Only override the logger when the config key is present, or default to the current logger level instead.

Useful? React with 👍 / 👎.

self._configure_expert_parallel(model)
if self.autotp_size() > 1:
self._configure_tensor_parallel(model, self.tensor_parallel_config())
Expand Down Expand Up @@ -1228,6 +1229,9 @@ def use_node_local_storage(self):
def load_universal_checkpoint(self):
return self._config.load_universal_checkpoint

def log_level(self):
return self._config.log_level

@property
def communication_data_type(self):
res = self._config.communication_data_type
Expand Down
Loading