Skip to content

Add ORT fused adam optimizer#295

Merged
JingyaHuang merged 2 commits into
mainfrom
zhijxu-add-ort-fused-adam
Jul 22, 2022
Merged

Add ORT fused adam optimizer#295
JingyaHuang merged 2 commits into
mainfrom
zhijxu-add-ort-fused-adam

Conversation

@JingyaHuang
Copy link
Copy Markdown
Contributor

@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

@JingyaHuang JingyaHuang requested a review from mfuntowicz July 13, 2022 18:22
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Jul 13, 2022

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

@JingyaHuang
Copy link
Copy Markdown
Contributor 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 echarlaix, michaelbenayoun and regisss and removed request for regisss July 13, 2022 18:27
Copy link
Copy Markdown
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!!

Comment thread optimum/onnxruntime/trainer.py Outdated
@zhijxu-MS
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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