TimeSearch-R-raw / scripts /zero3_offload_4.json
CSDDSFSFSAFSAF's picture
Add files using upload-large-folder tool
d50283e verified
Invalid JSON: Expected double-quoted property name in JSON at line 25, column 31
{
"fp16": {
"enabled": "auto",
"loss_scale": 0,
"loss_scale_window": 1000,
"initial_scale_power": 16,
"hysteresis": 2,
"min_loss_scale": 1
},
"bf16": {
"enabled": "auto"
},
"optimizer": {
"type": "AdamW",
"params": {
"lr": "auto",
"betas": "auto",
"eps": "auto",
"weight_decay": "auto"
}
},
"zero_optimization": {
"stage": 3,
"offload_optimizer": {
"device": "cpu", // 【关键修改1】将优化器状态卸载到 CPU,节省巨大显存
"pin_memory": true
},
"offload_param": {
"device": "cpu", // 保持开启参数卸载
"pin_memory": true
},
"overlap_comm": true,
"contiguous_gradients": true,
"sub_group_size": 1e9,
"reduce_bucket_size": "auto",
"stage3_prefetch_bucket_size": 5e7, // 【关键修改2】调小预取桶,避免一次性预取太多参数挤爆显存 (默认 auto 有时偏大)
"stage3_param_persistence_threshold": 1e6, // 【关键修改3】调大这个值,不让小参数常驻显存
"stage3_max_live_parameters": 1e9,
"stage3_max_reuse_distance": 1e9,
"gather_16bit_weights_on_model_save": true
},
"gradient_accumulation_steps": "auto",
"gradient_clipping": "auto",
"train_batch_size": "auto",
"train_micro_batch_size_per_gpu": "auto",
"steps_per_print": 100, // 方便调试,不用设那么大
"wall_clock_breakdown": false
}