ORTTrainer / ORTSeq2SeqTrainer refactoring - Inference with ORTModel#189
Merged
Conversation
…ngface/optimum into refactoring-orttrainer-inf
|
The documentation is not available anymore as the PR was closed or merged. |
echarlaix
approved these changes
Sep 5, 2022
* Override export of ORTSeq2SeqTrainer * Do not force download by default in ORTModel (#356) * Update OnnxConfigWithLoss wrapper * ORT optimizer refactorization (#294) * Refactorization of ORTOptimizer * Refactorization of ORTModel * Adapt examples according to refactorization * Adapt tests * Fix style * Remove quantizer modification * Fix style * Apply modifications from #270 for quantizer and optimizer to have same behavior * Add test for optimization of Seq2Seq models * Fix style * Add ort config saving when optimizing a model * Add ort config saving when quantizing a model * Add tests * Fix style * Adapt optimization examples * Fix readme * Remove unused parameter * Adapt quantization examples * Fix quantized model and ort config saving * Add documentation * Add model configuration saving to simplify loading of optimized model * Fix style * Fix description * Fix quantization tests * Remove opset argument which is onnx config default opset when exporting with ORTModels * Fix import (#360) * Fix export of decoders * Add flag to export only decoders * Fix ORTTrainer inference ort subclass parsing * Fix filenames when empty suffix given (#363) * fix(optimization): handle empty file suffix * fix(quantization): handle empty file suffix * use pathlibfor save_dir * run test again * Update optimum/onnxruntime/quantization.py Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com> * ReRun test that failed because of cache (network) Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com> * Override the evaluation and prediction loop in ORTSeq2SeqTrainer * Fix documentation (#369) * fix class * Update optimization.mdx * Fix label smoother device prob * Fix lm_logits and labels dimension mismatch * Clean up Co-authored-by: fxmarty <9808326+fxmarty@users.noreply.github.com> Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com> Co-authored-by: Pierre Snell <ierezell@gmail.com> Co-authored-by: Pierre Snell <pierre.snell@botpress.com> Co-authored-by: Philipp Schmid <32632186+philschmid@users.noreply.github.com>
regisss
reviewed
Sep 7, 2022
Contributor
regisss
left a comment
There was a problem hiding this comment.
Great work Jingya 🔥
I just have two naive questions
regisss
approved these changes
Sep 7, 2022
5 tasks
echarlaix
requested changes
Sep 19, 2022
Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
echarlaix
reviewed
Sep 19, 2022
Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR replaces the bare inference sessions in
ORTTrainerwith subclasses ofORTModel, and enables the inference with ONNX Runtime inORTSeq2SeqTrainer.[Refactoring
ORTTrainer]evaluation_loop_ortandprediction_loop_ortwith subclasses ofORTModel.evaluation_loop_ortandprediction_loop_ort[Refactoring
ORTSeq2SeqTrainer]OnnxConfigWithPastAndLosson the top ofDecoderOnnxConfig._DecoderWithLMhead.evaluation_loop_ortandprediction_loop_ortto leverageORTModelForSeq2SeqLM.