set mbsz and revert non-packed test

This commit is contained in:
Wing Lian
2025-07-06 12:27:25 -04:00
parent 07ab737a55
commit 47a88da330

View File

@@ -50,6 +50,7 @@ def sft_base_cfg():
flash_attention=True, flash_attention=True,
learning_rate=0.00001, learning_rate=0.00001,
optimizer="adamw_8bit", optimizer="adamw_8bit",
micro_batch_size=2,
) )
return cfg return cfg
@@ -73,31 +74,42 @@ class TestMultiGPULlama:
Test case for Llama models using LoRA Test case for Llama models using LoRA
""" """
def test_lora_ddp(self, temp_dir, sft_prepared_dataset_alpaca_cfg): def test_lora_ddp(self, temp_dir):
# pylint: disable=duplicate-code # pylint: disable=duplicate-code
cfg = ( cfg = DictDefault(
DictDefault( {
{ "base_model": "HuggingFaceTB/SmolLM2-135M",
"adapter": "lora", "sequence_len": 2048,
"lora_r": 8, "adapter": "lora",
"lora_alpha": 16, "lora_r": 8,
"lora_dropout": 0.05, "lora_alpha": 16,
"lora_target_linear": True, "lora_dropout": 0.05,
"num_epochs": 1, "lora_target_linear": True,
"max_steps": 2, "val_set_size": 0.01,
"micro_batch_size": 1, "special_tokens": {
"gradient_accumulation_steps": 2, "pad_token": "<|endoftext|>",
# "gradient_checkpointing": True, },
"output_dir": temp_dir, "datasets": [
"learning_rate": 0.00001, {
"optimizer": "adamw_8bit", "path": "tatsu-lab/alpaca",
"lr_scheduler": "cosine", "type": "alpaca",
"flash_attention": True, "split": "train[:10%]",
"use_tensorboard": True, },
"bf16": True, ],
} "num_epochs": 1,
) "max_steps": 2,
| sft_prepared_dataset_alpaca_cfg "micro_batch_size": 1,
"gradient_accumulation_steps": 2,
# "gradient_checkpointing": True,
"output_dir": temp_dir,
"dataset_prepared_path": temp_dir + "/last_run_prepared",
"learning_rate": 0.00001,
"optimizer": "adamw_8bit",
"lr_scheduler": "cosine",
"flash_attention": True,
"use_tensorboard": True,
"bf16": True,
}
) )
# write cfg to yaml file # write cfg to yaml file