Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/LYMDLUT/zpdb
https://github.com/LYMDLUT/zpdb
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/LYMDLUT/zpdb
- Owner: LYMDLUT
- Created: 2023-09-12T15:05:58.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2023-09-14T08:57:56.000Z (9 months ago)
- Last Synced: 2024-03-15T07:49:29.128Z (3 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome-cs-tutorial - https://github.com/LYMDLUT/zpdb
README
# ZPDB
> Python debug configuration generator for vscode## Install
```shell script
pip install zpdb
```## Command Line Tools
### zpdb
VSCode debug configuration generator from a python command line.It can automatically generate the debug configuration file for vscode by just adding `zpdb` in front of your python command.
It will parse the environment variables and the arguments list correctly.For example:
```shell
zpdb CUDA_VISIBLE_DEVICES=1,2 python train.py --batch-size 16 --lr 1e-4
zpdb CUDA_VISIBLE_DEVICES=1,2 accelerate lauch train.py --batch-size 16 --lr 1e-4
zpdb CUDA_VISIBLE_DEVICES=1,2 torchrun --nnodes=1 --nproc_per_node=2 train.py --config ./configs/7B_sft.py --launcher "torch"
```It will generate the debug configuration in `.vscode/launch.json`.
Then you can debug your python file by clicking the corresponding button.```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: python train.py --batch-size 16 --lr 1e-4",
"type": "python",
"request": "launch",
"program": "train.py",
"env": {
"CUDA_VISIBLE_DEVICES": "1,2"
},
"console": "integratedTerminal",
"args": [
"--batch-size",
"16",
"--lr",
"1e-4"
],
"cwd": "/home/xxx/demo_project"
}
]
}
```1. This repo based on vpdb:https://github.com/silverbulletmdc/vpdb
2. Support torchrun and accelerate