lm-sys / lm-sys/FastChat

LoRA fine-tuning for fastchat-3b exits with return code = -7

Open
#1,942 1 comment 0 reactions 1 assignee View on GitHub

@BabyChouSr is already working on this.

Since Jul 13, 2023.

Dominant language
Python
Stars
39.5k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm fine-tuning a fastchat-3b model with LoRA. The processes are getting killed at the `trainer.train()` step with the following log / error:
```
Loading extension module cpu_adam...
Time to load cpu_adam op: 1.6071059703826904 seconds
Loading extension module cpu_adam...
Time to load cpu_adam op: 1.6841044425964355 seconds
Rank: 1 partition count [2] and sizes[(2359296, False)]
Rank: 0 partition count [2] and sizes[(2359296, False)]
[2023-07-13 10:03:24,669] [INFO] [launch.py:315:sigkill_handler] Killing subprocess 12267
[2023-07-13 10:03:24,802] [INFO] [launch.py:315:sigkill_handler] Killing subprocess 12268
[2023-07-13 10:03:24,802] [ERROR] [launch.py:321:sigkill_handler] ['/opt/conda/bin/python', '-u', sys args...] exits with return code = -7
```

I made the following two changes in code & executing it with below command
1. Commented out the import & use of `replace_llama_attn_with_flash_attn` due to some package issues
2. Updated the below class to suit fastchat model with T5 architecture
```
@dataclass
class LoraArguments:
lora_r: int = 8
lora_alpha: int = 16
lora_dropout: float = 0.05
lora_target_modules: typing.List[str] = field(
#default_factory=lambda: ["q_proj", "v_proj"]
default_factory=lambda: ["q", "v"]
)
lora_weight_path: str = ""
lora_bias: str = "none"
q_lora: bool = False
```
```
deepspeed train_lora.py \
--model_name_or_path checkpoints_fastchat/lmsys/fastchat-t5-3b-v1.0 \
--lora_r 8 \
--lora_alpha 16 \
--lora_dropout 0.05 \
--data_path data/ust/input_data.json \
--bf16 True \
--output_dir data \
--num_train_epochs 4 \
--per_device_train_batch_size 1 \
--per_device_eval_batch_size 0 \
--gradient_accumulation_steps 1 \
--evaluation_strategy "no" \
--save_strategy "steps" \
--save_steps 5 \
--save_total_limit 100 \
--learning_rate 2e-5 \
--weight_decay 0. \
--warmup_ratio 0.03 \
--lr_scheduler_type "cosine" \
--logging_steps 1 \
--tf32 True \
--model_max_length 2048 \
--q_lora False \
--deepspeed FastChat/playground/deepspeed_config_s2.json
```

Please suggest some possible issues to look out for & a resolution, if any.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.