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

Implement: multiple save and load for mlflow registry #416

Merged
merged 7 commits into from
Sep 26, 2024
Merged

Conversation

yleilawang
Copy link
Collaborator

  1. Implemented save_multiple and load_multiple for mlflow registry
  2. Test cases for implementation.

@yleilawang yleilawang marked this pull request as ready for review September 19, 2024 19:39
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 59.37500% with 13 lines in your changes missing coverage. Please review.

Project coverage is 92.02%. Comparing base (b18b2d2) to head (69caf21).

Files with missing lines Patch % Lines
numalogic/registry/mlflow_registry.py 59.37% 10 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #416      +/-   ##
==========================================
- Coverage   92.20%   92.02%   -0.18%     
==========================================
  Files          98       98              
  Lines        4834     4865      +31     
  Branches      437      442       +5     
==========================================
+ Hits         4457     4477      +20     
- Misses        277      285       +8     
- Partials      100      103       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@s0nicboOm s0nicboOm left a comment

Choose a reason for hiding this comment

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

Also, update the version for pyproject.toml

numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
@ab93
Copy link
Member

ab93 commented Sep 23, 2024

Also, update the version for pyproject.toml

@s0nicboOm we have not released any previous versions right?

Signed-off-by: Leila Wang <[email protected]>
Signed-off-by: Leila Wang <[email protected]>
@yleilawang
Copy link
Collaborator Author

Added changes for:

  1. Changed return type of load_multiple to ArtifactData, the same return type of load.
  2. Slots for CompositeModels class.
  3. Handling exceptions caused by unwarpping pyfunc models.
  4. Private function for getting unique sorted dkey list.
  5. Added test cases for cache loading for pyfunc models.

@yleilawang
Copy link
Collaborator Author

Profiling Updates

reg.save(skeys=skeys, dkeys= ["ae", "pipeline"], artifact=VanillaAE(10), artifact_type='pytorch', **{"a": "b"})
reg.save(skeys=skeys, dkeys= ["scaler", "pipeline"], artifact=StandardScaler(), artifact_type='sklearn', **{"a": "b"})
reg.save(skeys=skeys, dkeys= ["threshold", "pipeline"], artifact=StdDevThreshold(), artifact_type='sklearn', **{"a": "b"})

output = reg.save_multiple(
    skeys=skeys, dkeys=dkeys, dict_artifacts=dict_artifacts, **{"a": "b"}
)

def f():
    reg.load(skeys=skeys, dkeys= ["ae", "pipeline"], artifact_type='pytorch')
    reg.load(skeys=skeys, dkeys= ["scaler", "pipeline"], artifact_type='sklearn')
    reg.load(skeys=skeys, dkeys= ["threshold", "pipeline"], artifact_type='sklearn')

def g():
    reg.load_multiple(skeys=skeys, dkeys=dkeys)

import timeit

a = timeit.timeit(f, number=100)
b = timeit.timeit(g, number=100)

print(a, b)

--> 9.074686333002319 4.829918750001525

yleilawang and others added 2 commits September 25, 2024 17:55
Signed-off-by: Leila Wang <[email protected]>
Signed-off-by: Leila Wang <[email protected]>
numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
Signed-off-by: Leila Wang <[email protected]>
Copy link
Member

@ab93 ab93 left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Contributor

@s0nicboOm s0nicboOm left a comment

Choose a reason for hiding this comment

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

Minor comments.
Otherwise LGTM!

numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
numalogic/registry/mlflow_registry.py Outdated Show resolved Hide resolved
Signed-off-by: Leila Wang <[email protected]>
@yleilawang yleilawang merged commit 4d05d95 into main Sep 26, 2024
11 checks passed
@yleilawang yleilawang deleted the save_multiple branch September 26, 2024 18:46
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