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
[BUG]: Setting up async logging flag is not taking effect. #11518
Comments
Q: The xgboost uses async in all places if async is feasible: mlflow/mlflow/xgboost/__init__.py Line 617 in 83b6c5f
But the |
We are considering to make mlflow log_artifact supporting async, after it is supported, you can start work for addressing this ticket :) |
Hi @WeichenXu123 , thank you for your reply. The typical complain that i am seeing is where customers are not directly making calls to mlflow and are setting the env level flag to turn on async flow, it is not working for them. Let me know what could be missing here so as to make it work for all such wrappers for different providers. Ex. For pytorch lightning class MLFlowLogger(OSSMLFlowLogger):
def __init__(self):
try: # pragma: no cover
run = Run.get_context()
mlflow_url = run.experiment.workspace.get_mlflow_tracking_uri()
experiment_name = run.experiment.name
super().__init__(
experiment_name=experiment_name,
tracking_uri=mlflow_url,
)
# Customer tried this approach, which did not work
self.experiment.enable_async_logging(enable=True)
# Nor - below approach work for enabling async logging flow
import mlflow
mlflow.enable_async_logging(enable=True)
self._run_id = run.id
except AttributeError:
mlflow_url = None
experiment_name = "lightning_logs"
info("MLFlowLogger: Offline run, No MLFlow tracking uri found")
super().__init__(
experiment_name=experiment_name,
tracking_uri=mlflow_url,
)
@rank_zero_only
def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None) -> None:
info(f"MLFlowLogger log metrics on step: {step}, metrics: {metrics}.")
# ... Do something
# This is not working as expected.
self.experiment.log_batch(self.run_id, metrics=metrics_to_log) |
is it a if so, then We can fix it. |
@BenWilson2 Please reply to comments. |
Issues Policy acknowledgement
Where did you encounter this bug?
Local machine
Willingness to contribute
Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.
MLflow version
System information
Describe the problem
When I run below code in AzureML context, i expect it to call async APIs on backend but it does not, it still calls the regular LogBatch sync API.
So i see some 429s being thrown and also i want this flow to work and call async APIs in backend.
Tracking information
Code to reproduce issue
Stack trace
Other info / logs
What component(s) does this bug affect?
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, autologgingWhat interface(s) does this bug affect?
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 supportWhat language(s) does this bug affect?
language/r
: R APIs and clientslanguage/java
: Java APIs and clientslanguage/new
: Proposals for new client languagesWhat integration(s) does this bug affect?
integrations/azure
: Azure and Azure ML integrationsintegrations/sagemaker
: SageMaker integrationsintegrations/databricks
: Databricks integrationsThe text was updated successfully, but these errors were encountered: