liangwq / Chatglm_lora_multi-gpu

chatglm多gpu用deepspeed和

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

请问ddp模式的如何分布式导入模型?

bai1451746927 opened this issue · comments

我使用
model = ChatGLMForConditionalGeneration.from_pretrained(
model_name, load_in_8bit=False, trust_remote_code=True
)
model=DDP(model.cuda(), device_ids=[2])
结果报错内存溢出,判断应该是一个模型在显卡里加载了两遍,请问如何处理

我使用 model = ChatGLMForConditionalGeneration.from_pretrained( model_name, load_in_8bit=False, trust_remote_code=True ) model=DDP(model.cuda(), device_ids=[2]) 结果报错内存溢出,判断应该是一个模型在显卡里加载了两遍,请问如何处理

直接用deepspeed配置文件,理解下每个参数