lm-sys / lm-sys/FastChat

How to use a single GPU for training?

Open
#1,640 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi!
I use a single gpu A100(40G).

export NCCL_IB_DISABLE=1;
export NCCL_P2P_DISABLE=1;
export NCCL_DEBUG=INFO;
export NCCL_SOCKET_IFNAME=en,eth,em,bond;
export CXX=g++;
deepspeed --num_gpus 1 --num_nodes 1 \
fastchat/train/train_mem.py \
    --model_name_or_path ../hf-llama-7B  \
    --data_path ../merged.json \
    --bf16 True \
    --output_dir finetune_output \
    --num_train_epochs 3 \
    --per_device_train_batch_size 1 \
    --per_device_eval_batch_size 1 \
    --gradient_accumulation_steps 16 \
    --evaluation_strategy "no" \
    --save_strategy "steps" \
    --save_steps 1200 \
    --save_total_limit 10 \
    --learning_rate 2e-5 \
    --weight_decay 0. \
    --warmup_ratio 0.03 \
    --lr_scheduler_type "cosine" \
    --logging_steps 1 \
    --tf32 True \
    --model_max_length 512 \
    --gradient_checkpointing True \
    --lazy_preprocess True \
    --deepspeed deepspeed.json

deepspeed.json:

{
    "zero_optimization":{
        "stage":3,
        "offload_optimizer":{
            "device":"cpu",
            "pin_memory":true
        },
        "overlap_comm":true,
        "contiguous_gradients":true
    },
    "optimizer":{
        "type":"AdamW",
        "params":{
            "lr":"auto",
            "betas":"auto",
            "eps":"auto",
            "weight_decay":"auto"
        }
    },
    "train_micro_batch_size_per_gpu":"auto"
}

but I got an error code: -9.

Can you help me?

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.

Research direction

Start with fastchat/train/train_mem.py and the provided DeepSpeed launch command and deepspeed.json. Reproduce the single-GPU run with the listed environment variables and capture what produces error code -9. Done means identifying a project-level cause and documenting or correcting the configuration so the command completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.