Main reason: 无法通过 Trainer 跑通 Jittor single driver。此次更新,支持 Jittor single driver,并添加对应 Trainer 的测试用例
Checklist 检查下面各项是否完成
[x] The PR title starts with [$CATEGORY] (例如[bugfix]修复bug,[new]添加新功能,[test]修改测试,[rm]删除旧代码)
[x] Changes are complete (i.e. I finished coding on this PR) 修改完成才提PR
[x] All changes have test coverage 修改的部分顺利通过测试。对于fastnlp/fastnlp/的修改,测试代码必须提供在fastnlp/test/。
[x] Code is well-documented 注释写好,API文档会从注释中抽取
[x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change 修改导致例子或tutorial有变化,请找核心开发人员
Description: 支持 Jittor single driver,并添加测试用例
Main reason: 无法通过 Trainer 跑通 Jittor single driver。此次更新,支持 Jittor single driver,并添加对应 Trainer 的测试用例
Checklist 检查下面各项是否完成
Changes:
fastNLP/core/drivers/jittor_driver/jittor_driver.py 中修改初始化函数
fastNLP/core/drivers/jittor_driver/single_device.py 中更改默认调用的 forward 函数为 execute 函数
fastNLP/core/drivers/jittor_driver/single_device.py 中实现父类抽象函数 setup
添加文件 tests/core/controllers/test_trainer_jittor.py,添加对应 pytest 测试用例,通过 Trainer 测 Jittor single driver。该测试中,断言模型训练效果:准确率在80%以上。测试用时约 1.5s。
Mention:
@x54-729 @yhcc