fastnlp / fastNLP

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.
https://gitee.com/fastnlp/fastNLP
Apache License 2.0
3.05k stars 451 forks source link

[bugfix]修复Trainer里check_code函数忽略pin_memory参数导致的内存不足bug #399

Closed ouyhlan closed 2 years ago

ouyhlan commented 2 years ago

Description:修复Trainer里check_code函数忽略pin_memory参数导致的内存不足bug

Main reason: 在使用fastNLP库时发生内存不足错误。使用场景是在使用CPU训练模型时,发生了内存错误。经过DEBUG发现,是core/Trainer.py文件里,_check_code函数在调用Tester类时没有指定pin_memory参数,而Tester类默认初始化pin_memory为True。 此次修改,是在_check_code函数里使用用户传入的pin_memory参数。经过测试,问题修复成功。希望尽快修复这个错误!

Checklist 检查下面各项是否完成

Please feel free to remove inapplicable items for your PR.

Changes: 逐项描述修改的内容

Mention: 找人review你的PR

@yhcc

yhcc commented 2 years ago

我们现在主要在dev分支上开发,麻烦您重新提交到dev分支,谢谢~