-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Feast-MLflow Integration #6235
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
Open
Vperiodt
wants to merge
3
commits into
feast-dev:master
Choose a base branch
from
Vperiodt:feast-mlflow
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feast-MLflow Integration #6235
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| """ | ||
| MLflow integration for Feast Feature Store. | ||
|
|
||
| This module provides seamless integration between Feast and MLflow. When enabled | ||
| in feature_store.yaml, feature metadata is logged to MLflow | ||
| during get_historical_features and get_online_features calls. | ||
|
|
||
| Usage: | ||
| Configure MLflow in your feature_store.yaml: | ||
|
|
||
| project: my_project | ||
| # ... other config ... | ||
|
|
||
| mlflow: | ||
| enabled: true | ||
| tracking_uri: http://localhost:5000 | ||
| auto_log: true | ||
|
|
||
| For advanced use cases, the module also provides: | ||
| - resolve_feature_service_from_model_uri: Map an MLflow model to its Feast | ||
| feature service. | ||
| - get_entity_df_from_mlflow_run: Reproduce training by pulling entity data | ||
| from a previous MLflow run's artifacts. | ||
| """ | ||
|
|
||
| from feast.mlflow_integration.config import MlflowConfig | ||
| from feast.mlflow_integration.entity_df_builder import ( | ||
| FeastMlflowEntityDfError, | ||
| get_entity_df_from_mlflow_run, | ||
| ) | ||
| from feast.mlflow_integration.logger import ( | ||
| log_feature_retrieval_to_mlflow, | ||
| log_training_dataset_to_mlflow, | ||
| ) | ||
| from feast.mlflow_integration.model_resolver import ( | ||
| FeastMlflowModelResolutionError, | ||
| resolve_feature_service_from_model_uri, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "MlflowConfig", | ||
| "log_feature_retrieval_to_mlflow", | ||
| "log_training_dataset_to_mlflow", | ||
| "resolve_feature_service_from_model_uri", | ||
| "FeastMlflowModelResolutionError", | ||
| "get_entity_df_from_mlflow_run", | ||
| "FeastMlflowEntityDfError", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| from typing import Optional | ||
|
|
||
| from pydantic import StrictBool, StrictStr | ||
|
|
||
| from feast.repo_config import FeastBaseModel | ||
|
|
||
|
|
||
| class MlflowConfig(FeastBaseModel): | ||
| enabled: StrictBool = False | ||
| """ bool: Whether MLflow integration is enabled. Defaults to False. """ | ||
|
|
||
| tracking_uri: Optional[StrictStr] = None | ||
| """ str: MLflow tracking URI. If not set, defaults to | ||
| http://127.0.0.1:5000 (local MLflow tracking server). | ||
| Set explicitly for remote/shared MLflow deployments. """ | ||
|
|
||
| auto_log: StrictBool = True | ||
| """ bool: Automatically log feature retrieval metadata to the active | ||
| MLflow run when get_historical_features or get_online_features is | ||
| called. Defaults to True. """ | ||
|
|
||
| auto_log_entity_df: StrictBool = False | ||
| """ bool: When True, the input entity_df (or SQL query) is recorded in | ||
| the MLflow run. Defaults to False. """ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡
_resolve_feature_service_nameusesp.nameinstead ofp.name_to_use(), causing feature service matching failuresThe
_resolve_feature_service_namemethod atsdk/python/feast/feature_store.py:273constructs feature service refs asf"{p.name}:{f.name}", but the_feature_refsit receives from callers (viautils._get_featuresatsdk/python/feast/utils.py:1164) are built usingf"{projection.name_to_use()}:{f.name}". Thename_to_use()method (sdk/python/feast/feature_view_projection.py:52-56) returnsself.name_alias or self.nameand may append@v{version_tag}. When a feature view projection has an alias or a version tag, the frozensets will never match, so the method silently returnsNoneand thefeast.feature_servicetag is never set in MLflow for those retrievals.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Resolved: The current analysis (ANALYSIS_0001) performed a more thorough trace of all calling paths and determined this is NOT a bug:
_resolve_feature_service_nameis only called whenfeaturesis aList[str](not a FeatureService), and in that code path_get_featuresreturns the user-provided strings as-is. User-provided feature refs use the original FV name (matchingp.name), so the comparison is consistent. The previous bug was a false positive.