Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chatllama] how to reduce the CUDA memory comsumption a llama7B model #315

Open
balcklive opened this issue Mar 31, 2023 · 0 comments
Open

Comments

@balcklive
Copy link

As I metioned in this Issue: #314
I am training a llama 7B model with 8 v100, totally I got 32 *8 G GPU memory. But at last, you can tell from the detail, I finally got a CUDA out of memory, fault.
Can anybody tell me Is there any other way that I can reduce my model memory comsuption on GPU?
my deepspeed config.json file is as below:
{

"gradient_accumulation_steps": 1,
"optimizer": {
  "type": "Adam",
  "params": {
    "lr": 0.00015
  }},

"zero_force_ds_cpu_optimizer": false,
"zero_optimization": {
"stage": 3,
"contiguous_gradients": true,
"stage3_max_live_parameters": 0,
"stage3_max_reuse_distance": 0,
"stage3_prefetch_bucket_size": 0,
"stage3_param_persistence_threshold": 1e2,
"reduce_bucket_size": 1e2,
"sub_group_size": 1e8,
"offload_optimizer": {
"device": "cpu",
"pin_memory": true
},
"offload_param": {
"device": "cpu",
"pin_memory": true
},
"stage3_gather_16bit_weights_on_model_save": true
},
"fp16": {
"enabled": true,
"auto_cast": false,
"loss_scale": 0,
"initial_scale_power": 32,
"loss_scale_window": 1000,
"hysteresis": 2,
"min_loss_scale": 1
},
"train_batch_size": 8,
"train_micro_batch_size_per_gpu": 1,
"wall_clock_breakdown": false
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant