{
"configurations": [
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
// 设置 torchrun 命令的参数
"program": "/home/xxx/anaconda3/envs/xxx/lib/python3.9/site-packages/torch/distributed/run.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"--nproc_per_node=1",
"--nnodes=1",
"--rdzv_backend=c10d",
"--rdzv_endpoint=localhost:12080", // 设置 torchrun 命令的参数
"/home/xxx/code/xx/tasks/train.py", // 要运行的python文件
"scripts/config.py",// python文件输入的参数
"model.stage=1",
"scheduler.epochs=6",
"optimizer.lr=2e-4",
"model.max_txt_len=32",
"model.add_scene_token=False",
"evaluate=False",
],
"env": {
"CUDA_VISIBLE_DEVICES": "0, 1" //环境相关的参数在这里
},
}
]
}
VSCode debug torchrun方式的多卡python代码
最新推荐文章于 2024-04-23 12:55:41 发布