-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mindnlp官方文档(https://mindnlp.cqu.ai/)示例代码错误反馈 #1794
Comments
ok |
@Helloyouth2022 错误1的下面我还遇到报错了。下面这一行会报错optimizer没有parameters属性 grad_fn = value_and_grad(forward_fn, None, optimizer.parameters) |
下面也是需要更新的,mindnlp的optimizer不同于mindspore,应该通过model直接传进去:grad_fn = value_and_grad(forward_fn, None, model.trainable_params()) |
https://mindnlp.cqu.ai/tutorials/peft/#training-step optimizer(grads)相应地改为:optimizer.step(grads) |
@Helloyouth2022 请问mindnlp在训练过程中是否需要手动执行zero grad?我在910B上用sgd训练longformer,训练过程中HBM会不断增加直到OOM |
目前了解到的是:mindspore的训练过程无需显示调用zero grad操作; 其实如果了解mindspore和pytorch在“获取模型梯度并使用梯度更新”操作上的差异,也很容易理解为什么在mindspore 上不用 梯度清零这个操作; |
##错误1
https://mindnlp.cqu.ai/tutorials/quick_start/#load-the-model
##错误2
https://mindnlp.cqu.ai/tutorials/quick_start/#prepare-a-dataset
https://mindnlp.cqu.ai/tutorials/data_preprocess/
##错误3
https://mindnlp.cqu.ai/tutorials/peft/#train-the-model
The text was updated successfully, but these errors were encountered: