-
Notifications
You must be signed in to change notification settings - Fork 454
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 ORTModel support for custom tasks #303
Conversation
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @JingyaHuang!!
Just one nit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we should make this change for enabling something, which the classes aren't designed for.
You said
e.g. In ORTTrainer, the evaluation includes labels as input and loss as output. With the PR, it will enable us to replace bare inference sessions with ORTModels more easily.
This sounds more that we should use evaluate
and pipeline
or the ORTModel in the trainer with the post-processing outside of the model.
…gingface/optimum into jingya-refactoring-ort-model
I still do not understand the purpose of this change. As mentioned before the The changes you suggest:
The question I have is:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a test and then we should be good. Good idea! ✅ And if some use case emerges out of it we can add new task-specific model classes
Hi @philschmid, sorry for the late reply. I re-drafted the code, indeed it shouldn't be in other task-specific models as it will slow them down. The basic idea behind the PR is to leave some flexibility to users, it's like a fallback so that when they are using a more customized model they can still be able to benefit from the ORTModel foundation with a small sacrifice of speed. |
What does this PR do?
ORTModelForXXX.model
decided valid inputs and outputs of the model's forward method, thus the creation of inputs in the forward method can be abstract, and also the outputs. This would allow the ORTModels to be more flexible.e.g. In
ORTTrainer
, the evaluation includes labels as input and loss as output. With the PR, it will enable us to replace bare inference sessions with ORTModels more easily.Before submitting