Skip to content
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

Add ORT fused adam optimizer #295

Merged
merged 2 commits into from
Jul 22, 2022
Merged

Add ORT fused adam optimizer #295

merged 2 commits into from
Jul 22, 2022

Conversation

JingyaHuang
Copy link
Collaborator

@JingyaHuang JingyaHuang commented Jul 13, 2022

What does this PR do?

  • Integrate ort fused adam optimizer
  • Subclass TrainingArguments to include ort optimizers
  • Update training examples
  • Add to the nightly test

Who can review

@zhijxu-MS @carzh

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jul 13, 2022

The documentation is not available anymore as the PR was closed or merged.

@JingyaHuang
Copy link
Collaborator Author

@JingyaHuang let's discuss here for ort-fused-adam.

with your new changes, i can run it locally, such as "question-answering/run_qa.py".

the issue you encountered looks like you are using an old ort, could you install a newer one. the install command is pip uninstall -y onnxruntime-training && pip install --pre --no-deps --no-index onnxruntime-training -f https://download.onnxruntime.ai/onnxruntime_nightly_cu113.html && TORCH_CUDA_ARCH_LIST='7.0;8.0+PTX' python -m torch_ort.configure

Hi @zhijxu-MS, thanks for the advice. I tested with onnxruntime nightly and it works well for me. 👍

As the previous branch was a little messy, I closed the previous and opened another PR here. Also I updated the examples as well as the test of ORTTrainer. Can you take a look if everything is ok for you? Thx!

@JingyaHuang JingyaHuang requested review from regisss, echarlaix and michaelbenayoun and removed request for regisss July 13, 2022 18:27
Copy link
Contributor

@regisss regisss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @JingyaHuang!!

optimum/onnxruntime/trainer.py Outdated Show resolved Hide resolved
@zhijxu-MS
Copy link
Contributor

@JingyaHuang let's discuss here for ort-fused-adam.
with your new changes, i can run it locally, such as "question-answering/run_qa.py".
the issue you encountered looks like you are using an old ort, could you install a newer one. the install command is pip uninstall -y onnxruntime-training && pip install --pre --no-deps --no-index onnxruntime-training -f https://download.onnxruntime.ai/onnxruntime_nightly_cu113.html && TORCH_CUDA_ARCH_LIST='7.0;8.0+PTX' python -m torch_ort.configure

Hi @zhijxu-MS, thanks for the advice. I tested with onnxruntime nightly and it works well for me. 👍

As the previous branch was a little messy, I closed the previous and opened another PR here. Also I updated the examples as well as the test of ORTTrainer. Can you take a look if everything is ok for you? Thx!

i tested 4 optimum examples locally, they can be run w/ or w/o ort-fused-adam. and make sure ort-fused-adam is called by adding log.

Copy link
Member

@mfuntowicz mfuntowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 😃

@JingyaHuang
Copy link
Collaborator Author

Thanks for the review @mfuntowicz @regisss @zhijxu-MS , will merge it.

@JingyaHuang JingyaHuang merged commit de2a1f1 into main Jul 22, 2022
@JingyaHuang JingyaHuang deleted the zhijxu-add-ort-fused-adam branch July 22, 2022 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants