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

✨Deepsparse Backend implementation #29

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

parfeniukink
Copy link
Contributor

@parfeniukink parfeniukink commented Aug 22, 2024

Summary

The Deepsparse Backend interface is implemented.

  • Optional dependency is specified in pyproject.toml file
  • Some ruff errors are suppressed
  • DeepsparseBackend gets configurations from CLI, environment or defaults
  • settings.py::DeepsparseSettings includes all the settings
  • tests/unit/backend/deepsparse.py includes unit tests
    • TestTextGenerationPipeline mocks the deepsparse.pipeline.Pipeline
    • tests are skipped if the Python version is not in a range between Python3.8 and Python3.11 (including).

Usage

This is an example of a command you can use in your terminal:

  • --data=openai_humaneval: determines the dataset
  • --model=/local/path/my_model: determines the local path to the model object. If not specified - the env variable will be used.
python -m src.guidellm.main --data=openai_humaneval --max-requests=1 --max-seconds=20 --rate-type=constant --rate=1.0 --backend=deepsparse --model=/local-path

Environment configuration

The model could also be set with GUIDELLM__LLM_MODEL. If the CLI value or environment variable is not set, then the default will be used. Currently, the default model is: mistralai/Mistral-7B-Instruct-v0.3.

@parfeniukink parfeniukink self-assigned this Aug 22, 2024
Dmytro Parfeniuk added 6 commits August 26, 2024 14:28
* settings.py::DeepsparseSettings includes all the settings
* tests/unit/backend/deepsparse.py includes unit tests
* `TestTextGenerationPipeline` mocks the `deepsparse.pipeline.Pipeline`
@parfeniukink parfeniukink changed the title Parfeniukink/features/deepsparse backend Deepsparse Backend implementation Aug 28, 2024
@parfeniukink parfeniukink marked this pull request as ready for review August 28, 2024 13:48
src/guidellm/backend/deepsparse/backend.py Outdated Show resolved Hide resolved
Comment on lines 3 to 4
from deepsparse import Pipeline
from deepsparse import Pipeline, TextGeneration
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean deepsparse is a dep of guidellm? We should keep it optional at most IMO, so could this be in a try catch with an informational message to install?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mgoin Could you please check this file? Is it kind of a validation you are talking about?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, since the backend/deepsparse/__init__.py exists we determine it as a module so before you reach the deepsparse/backend.py you are going to run such a validation.

Also, all the imports are like from guidellm.backend import Backend, BackendEngine but if you need the deepsparse just from .guidellm.backend.deepsparse import DeepsparseBackend which runs this validation.

Also the deepsparse is an optional dependency. At least it is in optional section

@parfeniukink parfeniukink changed the title Deepsparse Backend implementation ✨Deepsparse Backend implementation Aug 30, 2024
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.

2 participants