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

Model Cache Management Features #239

Merged
merged 72 commits into from
Jan 6, 2023
Merged

Model Cache Management Features #239

merged 72 commits into from
Jan 6, 2023

Conversation

wanliAlex
Copy link
Collaborator

@wanliAlex wanliAlex commented Dec 16, 2022

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    features

  • What is the current behavior? (You can also link to an open issue here)
    users can not view the loaded models and eject a model from the client

  • What is the new behavior (if this is a feature change)?
    users can now view loaded models, eject models, view cuda information from the client

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    no

  • Have unit tests been run against this PR? (Has there also been any additional testing?)
    not yet

  • Related Python client changes (link commit/PR here)
    will link later

  • Related documentation changes (link commit/PR here)
    will link later

  • Other information:
    this PR is related to the issue

  • Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)

@wanliAlex wanliAlex changed the title Add Model Cache Management Features [draft] Add Model Cache Management Features Dec 16, 2022
@pandu-k
Copy link
Collaborator

pandu-k commented Dec 19, 2022

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

FYI
Adding new API endpoints is not a breaking change. A breaking change is updating an existing endpoint such that it is no longer backwards compatible (so existing users have to update their code to use the new version).

An example of a breaking change is when the add_documents batch_size parameter was replaced by server_batch_size and client_batch_size parameters. Users wanting to use the new py-marqo version would have to update their add_documents calls

@wanliAlex
Copy link
Collaborator Author

Thanks for the comment.

Copy link
Collaborator

@pandu-k pandu-k 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 this PR! Left actionable feedback in the comments.

Further to dos:

  • Action feedback
  • Create a series of unit tests. One that I propose is to load and unload a model ~10 times, to see if the cache is actually being unloaded (else the computer runs out of memory). Please include testing for unusual and edge cases.
  • Create corresponding Py-Marqo methods and a few unit tests
  • Given this is a new endpoint, create a few API tests. These don't have to be as exhaustive as the unit tests, but should test every endpoint.
    • An CUDA API test is proposed: load 2 CUDA models. Unload one. Test to ensure the remaining model is still cached. Test to ensure the unloaded model is indeed unloaded. Create API tests here. CUDA test classes are marked by this decorator. This ensures that the API test only runs on the CUDA test environment.

src/marqo/tensor_search/api.py Show resolved Hide resolved
src/marqo/errors.py Show resolved Hide resolved
src/marqo/s2_inference/errors.py Show resolved Hide resolved
src/marqo/s2_inference/s2_inference.py Show resolved Hide resolved
src/marqo/s2_inference/s2_inference.py Show resolved Hide resolved
src/marqo/tensor_search/tensor_search.py Outdated Show resolved Hide resolved
src/marqo/tensor_search/tensor_search.py Outdated Show resolved Hide resolved
src/marqo/tensor_search/tensor_search.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@pandu-k pandu-k left a comment

Choose a reason for hiding this comment

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

There are still a few pending questions. Tests are also to be made.

I have updated my review comment

Resolved most conversations.

src/marqo/s2_inference/s2_inference.py Show resolved Hide resolved
@wanliAlex wanliAlex requested a review from pandu-k January 2, 2023 23:07
@pandu-k pandu-k temporarily deployed to marqo-test-suite January 4, 2023 00:32 — with GitHub Actions Inactive
@pandu-k pandu-k temporarily deployed to marqo-test-suite January 4, 2023 00:32 — with GitHub Actions Inactive
@pandu-k pandu-k temporarily deployed to marqo-test-suite January 4, 2023 00:32 — with GitHub Actions Inactive
@pandu-k pandu-k temporarily deployed to marqo-test-suite January 4, 2023 00:32 — with GitHub Actions Inactive
@pandu-k pandu-k temporarily deployed to marqo-test-suite January 4, 2023 00:32 — with GitHub Actions Inactive
@pandu-k pandu-k temporarily deployed to marqo-test-suite January 4, 2023 00:33 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite January 5, 2023 06:23 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite January 5, 2023 06:24 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite January 5, 2023 06:24 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite January 5, 2023 06:24 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite January 5, 2023 06:24 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite January 5, 2023 06:24 — with GitHub Actions Inactive

else:
raise errors.HardwareCompatabilityError(message=str(
"ERROR: cuda is not supported in your machine!!"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make the error message stylistically similar to this existing one:

raise HardwareCompatabilityError(message="Requested device is not available to this Marqo instance."

@pandu-k pandu-k merged commit dd37904 into mainline Jan 6, 2023
@pandu-k pandu-k deleted the model-cache-management branch January 6, 2023 00:56
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