VS Code 调试

file

launch.json创建:可以点击菜单栏:运行->添加配置 生成

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "train_ds_zero2",
            "type": "debugpy",
            "request": "launch",
            "program": "/home/cs/anaconda3/envs/torch2x/bin/deepspeed", //"${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "args": [
                "--num_nodes",
                "1",
                "--num_gpus",
                "2",
                "${file}",
                "--deepspeed",
                "./config/default_offlload_zero2.json",
                "--model_name_or_path",
                "models",
                "--output_dir",
                "outputs"
            ],
            "env": {
                "CUDA_VISIBLE_DEVICES": "0,1",
                "PYDEVD_DISABLE_FILE_VALIDATION": "1",
            }
        },
    ]
}

references

https://code.visualstudio.com/docs/python/debugging

原创文章。转载请注明: 作者:meixi 网址: https://www.icnma.com
Like (0)
meixi管理
Previous 08/10/2024 14:48
Next 24/05/2023 16:59

猜你想看