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

Remove shap as core dependency #8199

Merged
merged 1 commit into from Apr 18, 2023
Merged

Conversation

jmahlik
Copy link
Contributor

@jmahlik jmahlik commented Apr 10, 2023

Related Issues/PRs

Closes #7681

What changes are proposed in this pull request?

Moving shap to an extra and gating the shap tab in recipes behind shap being installed. This was the one place I could find with a hard dependency on shap. Happy to make other adjustments if there are places that were missed.

This likely can be classed as a bug fix. I'm not sure if it would be considered a breaking change, since users will have to install mlflow and manage the shap install separately. It should for sure be mentioned in the release notes.

How is this patch tested?

Tested most of the relevant functionality without shap installed on 3.11. It's quite hard to run the full test suite on Windows/3.11 since some of the extra ml requirements are not readily installable.

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests (describe details, including test results, below)

Does this PR change the documentation?

  • No. You can skip the rest of this section.
  • Yes. Make sure the changed pages / sections render correctly in the documentation preview.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Move shap to an extra ml requirement to improve python 3.11 compatibility. Shap needs to be installed separately for the shap functionality in autologging/recipies.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/recipes: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

How should the PR be classified in the release notes? Choose one:

  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

@github-actions github-actions bot added area/recipes MLflow Recipes, Recipes APIs, Recipes configs, Recipe Templates area/tracking Tracking service, tracking client APIs, autologging rn/bug-fix Mention under Bug Fixes in Changelogs. labels Apr 10, 2023
@mlflow-automation
Copy link
Collaborator

mlflow-automation commented Apr 10, 2023

Documentation preview for 57fd4d8 will be available here when this CircleCI job completes successfully.

More info

@jmahlik jmahlik marked this pull request as draft April 10, 2023 15:24
@jmahlik
Copy link
Contributor Author

jmahlik commented Apr 10, 2023

I'll fix up the failing tests. Would it be worth adding a ci test against python 3.11 at all?

@jmahlik
Copy link
Contributor Author

jmahlik commented Apr 10, 2023

Landed on installing shap for the tests vs. removing it entirely and checking the for error logs. That seems to make more sense.

@jmahlik jmahlik marked this pull request as ready for review April 12, 2023 17:35
Copy link
Member

@BenWilson2 BenWilson2 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution @jmahlik :)

@BenWilson2
Copy link
Member

@sunishsheth2009 any objections to having a card not populated so that we don't have to have shap as a hard dependency?

@sunishsheth2009
Copy link
Collaborator

@sunishsheth2009 any objections to having a card not populated so that we don't have to have shap as a hard dependency?

I think this makes sense. Maybe we should add it here in that case: https://github.com/mlflow/recipes-examples/blob/main/requirements.txt

@jmahlik
Copy link
Contributor Author

jmahlik commented Apr 13, 2023

Rebased to resolve the conflict.

@jmahlik
Copy link
Contributor Author

jmahlik commented Apr 14, 2023

Looks like some possibly flakey tests failing for 404's on installing pyspark and mlleap serialization.

@BenWilson2
Copy link
Member

@jmahlik those test failures were due to the release of PySpark3.4 and a recent breaking release of mlserver. They've been fixed in master. :)

Signed-off-by: Justin Mahlik <38999128+jmahlik@users.noreply.github.com>
@jmahlik
Copy link
Contributor Author

jmahlik commented Apr 17, 2023

Rebased.

@BenWilson2 BenWilson2 merged commit 957331c into mlflow:master Apr 18, 2023
27 checks passed
@BenWilson2
Copy link
Member

Thanks for another great contribution @jmahlik 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/recipes MLflow Recipes, Recipes APIs, Recipes configs, Recipe Templates area/tracking Tracking service, tracking client APIs, autologging rn/bug-fix Mention under Bug Fixes in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Can't install on python 3.11
4 participants