question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FR] Why is there no 'log_model()' function in mlflow.client?

See original GitHub issue

Willingness to contribute

Yes. I would be willing to contribute this feature with guidance from the MLflow community.

Proposal Summary

I want to use mlflow by parallel runs. But, mlflow is not thread-safe. when using mlflow.start_run() code, run id becomes a global variable. So, every parallel runs become crashed.

I found a method of log_artifact() in mlflow.client(). This method is not log model and meta info of model to mlflow tracking server, but only save to registry server.

I want to method for mlflow.client like mlflow.skelarn.log_model() that is save model to registry and log to mlflow tracking server.

Is it possible?

Motivation

What is the use case for this feature?

When using mlflow.client, There is no way to log model to mlflow tracking server. log_artifact() method in mlflow.client is only save to registry not log.

Why is this use case valuable to support for MLflow users in general?

This feature is necessary to users who want to use mlflow in parallel.

Why is this use case valuable to support for your project(s) or organization?

Why is it currently difficult to achieve this use case?

Now I’,m using mlflow.onnx.log_model(). So parallel runs become crashed.

Details

No response

What component(s) does this bug affect?

  • 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

What interface(s) does this bug affect?

  • 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

What language(s) does this bug affect?

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

What integration(s) does this bug affect?

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

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jaehyeongANcommented, Nov 29, 2022

@WeichenXu123 Cool, I want to do that.

1reaction
harupycommented, Nov 28, 2022

@WeichenXu123 Got it.

I think we can add a method MLflowClient.log_model, like:

This approach sounds good to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MLflow Tracking — MLflow 2.0.1 documentation
Logging events for artifacts are made by the client using the HttpArtifactRepository to write files to MLflow Tracking Server. The Tracking Server then...
Read more >
MLflow 2.0.1 documentation
If no active run exists, a new MLflow run is created for logging these metrics and artifacts. Note that no metrics/artifacts are logged...
Read more >
MLflow Models — MLflow 2.0.1 documentation
Note that the load_model function assumes that all dependencies are already available and will not check nor install any dependencies ( see model...
Read more >
R API — MLflow 2.0.1 documentation
Loads an MLflow model. MLflow models can have multiple model flavors. Not all flavors / models can be loaded in R. This method...
Read more >
MLflow Model Registry
While the method above creates an empty registered model with no version associated, ... from pprint import pprint client = MlflowClient() for rm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found