本文主要是介绍vscode调试deepspeed代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
下面展示一个例子:
{"version": "0.2.0","configurations": [{"name": "Python: Debug DeepSpeed","type": "python","request": "launch","program": "/home/upa1/.conda/envs/dsmoe/bin/deepspeed","justMyCode": true,"console": "integratedTerminal","args": ["--num_nodes=1","--num_gpus=1","/data01/cym/Project/MoE/Megatron-DeepSpeed/Megatron-DeepSpeed/tools/generate_samples_gpt.py","--tensor-model-parallel-size", "1","--num-layers", "24","--hidden-size", "1024","--num-attention-heads", "16","--max-position-embeddings", "1024","--tokenizer-type", "GPT2BPETokenizer","--fp16","--num-experts", "1","--mlp-type", "standard","--micro-batch-size", "1","--seq-length", "1024","--out-seq-length", "1024","--temperature", "1.0","--vocab-file", "/data01/cym/Project/MoE/Megatron-DeepSpeed/Megatron-DeepSpeed/dataset/gpt2-vocab.json","--merge-file", "/data01/cym/Project/MoE/Megatron-DeepSpeed/Megatron-DeepSpeed/dataset/gpt2-merges.txt","--genfile", "unconditional_samples.json","--top_p", "0.9","--log-interval", "1","--num-samples", "0","--load", "/data01/cym/Project/MoE/Megatron-DeepSpeed/Megatron-DeepSpeed/dataset/checkpoints/gpt2_345m",]}]
}
- 其中
program
需要改成自己deepspeed所在位置,在运行环境中查看方式:which deeespeed
args
参数改成自己想要的就行。
这篇关于vscode调试deepspeed代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!