-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add document for model dependency management #10807
Conversation
Documentation preview for 6ee17a0 will be available here when this CircleCI job completes successfully. More info
|
However, in some cases, you may need to add or modify some dependencies. This page provides a high-level description of how MLflow manages | ||
dependencies and guidance for how to customize dependencies for your use case. | ||
|
||
.. contents:: Table of Contents |
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.
note: Showing table of contents as the side bar doesn't show indexes at this level.
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.
Good idea.
cloudpickle==2.5.8 | ||
sklearn==1.3.1 | ||
|
||
.. note:: |
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.
Let's add another warning here that manually declaring core dependencies for the model to function that are different from those that were used during training can be especially dangerous and prone to unexpected behavior.
docs/source/model/dependencies.rst
Outdated
|
||
.. note:: | ||
|
||
Once you log the model with custom dependencies, it is advisable to test prediction in sandbox environment using MLflow predict API, |
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.
Once you log the model with custom dependencies, it is advisable to test prediction in sandbox environment using MLflow predict API, | |
Once you log the model with custom dependencies, it is advisable to test prediction in sandbox environment using the MLflow predict API, |
"using the MLflow predict API functionality, introduced in MLflow 2.10.0...." (just in case users of older versions try this great feature out and find that the API doesn't exist in their version of MLflow)
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.
Great idea! Should be also helpful for users on pre-installed environment like MLR.
|
||
One workaround for this issue is to use the parent directory instead, which means doing ``code_path=["src"]`` in this example. | ||
This way, MLflow will copy the entire ``src/`` directory under ``code/`` and your model code will be able to import ``src.utils``. | ||
|
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.
Can we add a note for recommended file structures for dependent code inclusion? (we recommend including all dependent files in their own folder that is accessible from the main entry point of your training code, as a directory, that contains no other files or code structures that are not absolutely required for the proper functionality of your model) or something to that effect?
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.
Sure, I think what you mentioned is the recommended (or perhaps only viable) way for managing dependent code.
Fantastic job here @B-Step62 !! This is an overwhelmingly great improvement to some of the most often asked questions and confusing behavior, written up in a very easy-to-follow and clear direction. Great examples, too! |
Signed-off-by: B-Step62 <[email protected]>
Signed-off-by: B-Step62 <[email protected]>
Signed-off-by: B-Step62 <[email protected]>
Signed-off-by: B-Step62 <[email protected]>
Co-authored-by: Ben Wilson <[email protected]> Signed-off-by: Yuki Watanabe <[email protected]>
Signed-off-by: B-Step62 <[email protected]>
Signed-off-by: B-Step62 <[email protected]>
|
||
By the same reason, ``code_path`` option doesn't handle the relative import like ``code_path=["../src"]``. | ||
|
||
Recommended Project Structure |
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.
Awesome!
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.
Fantastic!
🛠 DevTools 🛠
Install mlflow from this PR
Checkout with GitHub CLI
What changes are proposed in this pull request?
Add a new page for describing how to deploy additional dependencies or code modules with MLflow.
How is this PR tested?
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/artifacts
: Artifact stores and artifact loggingarea/build
: Build and test infrastructure for MLflowarea/deployments
: MLflow Deployments client APIs, server, and third-party Deployments integrationsarea/docs
: MLflow documentation pagesarea/examples
: Example codearea/model-registry
: Model Registry service, APIs, and the fluent client calls for Model Registryarea/models
: MLmodel format, model serialization/deserialization, flavorsarea/recipes
: Recipes, Recipe APIs, Recipe configs, Recipe Templatesarea/projects
: MLproject format, project running backendsarea/scoring
: MLflow Model server, model deployment tools, Spark UDFsarea/server-infra
: MLflow Tracking server backendarea/tracking
: Tracking Service, tracking client APIs, autologgingInterface
area/uiux
: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/docker
: Docker use across MLflow's components, such as MLflow Projects and MLflow Modelsarea/sqlalchemy
: Use of SQLAlchemy in the Tracking Service or Model Registryarea/windows
: Windows supportLanguage
language/r
: R APIs and clientslanguage/java
: Java APIs and clientslanguage/new
: Proposals for new client languagesIntegrations
integrations/azure
: Azure and Azure ML integrationsintegrations/sagemaker
: SageMaker integrationsintegrations/databricks
: Databricks integrationsHow should the PR be classified in the release notes? Choose one:
rn/none
- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change
- The PR will be mentioned in the "Breaking Changes" sectionrn/feature
- A new user-facing feature worth mentioning in the release notesrn/bug-fix
- A user-facing bug fix worth mentioning in the release notesrn/documentation
- A user-facing documentation change worth mentioning in the release notes