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

Use ONNX models from HuggingFace #393

Open
wants to merge 2 commits into
base: model-api-v3
Choose a base branch
from

Conversation

seitzquest
Copy link
Contributor

@seitzquest seitzquest commented Jan 16, 2023

What does this PR do?

Changes onnx inference model's source from local file to HuggingFace repository

  • Added "onnx_use_quantized" field to model_config to specify if quantized model should be used or not
  • Removed model_path and replaced decoder_path with is_encoder_decoder to use Optimum's naming convention

We updated the existing onnx tests to use models from HF and added tests for quantized qa

We provide model configurations for extractive, categorical, multiple-choice and abstractive QA

  • See "model-inference/model_inference/api.dev.local.http" for query examples

Minor additional changes:

  • Corrected the generation task's return message in model-inference/model_inference/app/api/routes/prediction.py
  • Removed ONNX section in model-inference/README.md -> onnx workers are now created like any other model type

Who can review?

@HaritzPuerto
@Rachneet

@HaritzPuerto HaritzPuerto requested a review from Rachneet January 16, 2023 14:15
model-inference/model_inference/api.dev.local.http Outdated Show resolved Hide resolved
model-inference/model_inference/api.dev.local.http Outdated Show resolved Hide resolved
model-inference/tests/onnx/test_inference/test_onnx.py Outdated Show resolved Hide resolved
docker-compose.ytt.min.yaml Outdated Show resolved Hide resolved
@@ -207,6 +207,218 @@ services:
- rabbit
- redis


onnx_bert_worker:
Copy link
Collaborator

Choose a reason for hiding this comment

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

should these services really be part of the "minimal" version of square?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We copied the dependencies from the tasb_worker. When I try to remove rabbit or redis from any of our services, I get the following errors during requests:

  • amqp.exceptions.AccessRefused: (0, 0): (403) ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
  • redis.exceptions.ResponseError: WRONGPASS invalid username-password pair or user is disabled.

I think that 'minimal" in this case refers to the UI not being included

  • Maybe we should rename the file to "docker-compose.ytt.no-frontend.yaml"

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, services like Rabbit, Redis, Mongo etc they are dependencies of other core services, so no need to remove them.

However, I was more talking about the additional models that are added here. IMHO, this file should just deploy a single model and single datastore. This is basically just a demo of the each component. Therefore, I think we do not need additional models in this file. But please pitch in @Rachneet or @kwang2049 if you have a different opinion.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Rachneet do you want these model services to be added to the docker-compose.ytt.yaml or should they be deployed dynamically?

Copy link
Collaborator

Choose a reason for hiding this comment

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

They should be deployed dynamically. For testing purposes only, these services can be added to docker-compose.models.yaml file.

Copy link
Collaborator

@timbmg timbmg left a comment

Choose a reason for hiding this comment

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

Thanks for your work and PR! Just a couple of small changes and clarifications from my side. However, I have just looked superficially. @Rachneet can give more feedback.

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.

3 participants