Update doc for grad_accu and add validation tests for batch size

This commit is contained in:
NanoCode012
2023-06-01 06:13:47 +09:00
parent a6f5e5eaec
commit 3c71c8debe
3 changed files with 26 additions and 0 deletions

View File

@@ -8,6 +8,12 @@ def validate_config(cfg):
raise ValueError(
"please set only one of gradient_accumulation_steps or batch_size"
)
if cfg.batch_size:
logging.warning(
"%s\n%s",
"batch_size is not recommended. Please use gradient_accumulation_steps instead.",
"To calculate the equivalent gradient_accumulation_steps, divide batch_size / micro_batch_size / number of gpus.",
)
if cfg.load_4bit:
raise ValueError(
"cfg.load_4bit parameter has been deprecated and replaced by cfg.gptq"