mirror of
https://gitee.com/mindspore/mindformers.git
synced 2025-12-06 19:42:57 +08:00
hide monitor config
This commit is contained in:
@@ -1609,14 +1609,8 @@ class DeepseekV2ForCausalLM(DeepseekV2PreTrainedModel):
|
||||
vocab_size, mp)
|
||||
logger.warning("Now, the model_parallel num of Loss will be changed: mp = 1")
|
||||
loss_parallel_config.model_parallel = 1
|
||||
monitor_config = getattr(config, "monitor_config", None)
|
||||
monitor_on = getattr(monitor_config, "monitor_on", False)
|
||||
check_for_nan_in_loss_and_grad = monitor_on and bool(getattr(monitor_config, "local_loss_format", None))
|
||||
monitor_device_local_loss = monitor_on and bool(getattr(monitor_config, "device_local_loss_format", None))
|
||||
calculate_per_token_loss = getattr(config, "calculate_per_token_loss", False)
|
||||
self.loss = CrossEntropyLoss(parallel_config=loss_parallel_config,
|
||||
check_for_nan_in_loss_and_grad=check_for_nan_in_loss_and_grad,
|
||||
monitor_device_local_loss=monitor_device_local_loss,
|
||||
calculate_per_token_loss=calculate_per_token_loss,
|
||||
seq_split_num=config.parallel_config.seq_split_num)
|
||||
|
||||
|
||||
@@ -319,13 +319,7 @@ class TelechatForCausalLM(TelechatPreTrainedModel):
|
||||
logger.warning("Now, the model_parallel num of Loss will be changed: mp = 1")
|
||||
loss_parallel_config.model_parallel = 1
|
||||
loss_parallel_config.data_parallel *= loss_parallel_config.context_parallel
|
||||
monitor_config = getattr(config, "monitor_config", None)
|
||||
monitor_on = getattr(monitor_config, "monitor_on", False)
|
||||
check_for_nan_in_loss_and_grad = monitor_on and bool(getattr(monitor_config, "local_loss_format", None))
|
||||
monitor_device_local_loss = monitor_on and bool(getattr(monitor_config, "device_local_loss_format", None))
|
||||
self.loss = CrossEntropyLoss(parallel_config=loss_parallel_config,
|
||||
check_for_nan_in_loss_and_grad=check_for_nan_in_loss_and_grad,
|
||||
monitor_device_local_loss=monitor_device_local_loss)
|
||||
self.loss = CrossEntropyLoss(parallel_config=loss_parallel_config)
|
||||
|
||||
dp = config.parallel_config.data_parallel
|
||||
mp = config.parallel_config.model_parallel
|
||||
|
||||
Reference in New Issue
Block a user