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

Query engine for CMF #131

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

sergey-serebryakov
Copy link
Contributor

@sergey-serebryakov sergey-serebryakov commented Oct 16, 2023

Related Issues / Pull Requests

Description

This PR introduces a Query Engine analytic engine, one of several analytic engines to be developed for CMF.

The goal for analytic engines is to utilize machine learning and pipeline 
metadata collected by CMF to explain and characterize (e.g., sensitivity 
analysis or bias detection) executions of past pipelines and to improve 
(e.g., better hyperparameter search spaces) executions of future pipelines.

The query engine proposed in this PR is one of the first steps towards achieving the above-mentioned goal. Its purpose is to provide query and search functionality that is considered to be high-level to be part of lower-level APIs (such as graph or tabular API to access ML and pipeline metadata).

What changes are proposed in this pull request?

  • New feature (non-breaking change which adds functionality).
  • This change requires a documentation update.

Checklist:

  • My code follows the style guidelines of this project (PEP-8 with Google-style docstrings).
  • I have commented my code.
  • My code requires documentation updates, and I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

This commit adds doc strings and type annotation for CmfQuery class methods.
- References to `client` in the source code (e.g., CmfClient instead of CmfQuery) are removed.
- Several bugs related to checking input dict parameters are fixed (e.g., `d = d or {}` where it should be `if d is None: d= {}`). Now, the corrent object is returned when input dict is just empty.
- Missing doc strings and type annotations are added.
- Additional checks and log messages are added.
Fixing one possible bug related to accessing a column in a data frame when this data frame is empty.
Adding key mapper classes to help map source to target keys when copying dictionaries.
The API implements graph-like API to traverse CMF metadata in a graph-like manner. The entry point is the
`MetadataStore` class that retrieves from metadata store pipelines, stages, executions and artifacts. Users
can specify search query to specify what they want to return (the query is basically the value for the
`filter_query` parameter of the `ListOptions` class ML Metadata (MLMD) library).

Each node mentioned above (pipeline, stages, executions and artifacts) havs its own Python wrapper class that
provides developer-friendly API to access node's parameters and travers graph of machine learning concepts (e.g.,
get all stages of a pipeline or get all executions of a stage).

The graph API also provides the `Properties` wrapper for MLMD's properties and custom_propertied nodes' fields.
This wrapper implements the `Mapping` API and automatically converts MLMD's values to Python values on the fly.
- Adding unit tests (97% coverage).
- Renaming certain classes, redesigning implementation of several methods.
- Adding `Type` class that represents concepts such as ContextType, ExecutionType and ArtifactType in MLMD library.
- Implementation of multiple analytic functions.
- Unified mechanism to traverse graph of artifacts along their dependency paths.
- New traverse API.
- Base methods.
- Allow users to specify selection criteria for artifacts in some methods.
@sergey-serebryakov sergey-serebryakov changed the title Feature/query engine Query engine for CMF Oct 18, 2023
- Adding HPE header.
- Improving doc strings for classes that are responsible for traversing MLMD graph of artifacts.
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.

1 participant