HillZhang1999 / NaSGEC

Code & Data for our Paper "NaSGEC: Multi-Domain Chinese Grammatical Error Correction for Native Speaker Texts" (ACL 2023 Findings)
https://arxiv.org/abs/2305.16023
73 stars 6 forks source link

mutiple gpus #15

Open leleP9 opened 7 months ago

leleP9 commented 7 months ago

使用单卡执行generate.sh时显存不够,在设置CUDA_DEVICE=0,1后执行仍使用单卡预测,请问该怎么实现多卡预测?

HillZhang1999 commented 7 months ago

可能需要配置下device_map这个参数

leleP9 commented 7 months ago
参数

没有找到device_map这个参数,文档中有这些参数是与gpu有关的

leleP9 commented 7 months ago

同时还有一个问题想请教,现有多个超长文本作为输入,由于模型输入长度限制,目前按512对文本进行切分,且为了显存不溢出,将batchsize设置为1,但目前报错信息为: RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling cublasLtMatmul with transpose_mat1 1 transpose_mat2 0 m 1024 n 513 k 4096 mat1_ld 4096 mat2_ld 4096 result_ld 1024 abcType 2 computeType 68 scaleType 0 似乎还是由于输入过长导致,不知对于切句长度您是否有建议

HillZhang1999 commented 7 months ago

可以参考这一实践:https://huggingface.co/docs/accelerate/usage_guides/big_modeling