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

Refactor MLflow register_model #1545

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions llmfoundry/callbacks/hf_checkpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ def _maybe_get_license_filename(
return None


def _register_model_with_run_id_multiprocess(
def _register_model_multiprocess(
mlflow_logger: MLFlowLogger,
composer_logging_level: int,
model_uri: str,
name: str,
await_creation_for: int,
):
"""Call MLFlowLogger.register_model_with_run_id.
"""Call MLFlowLogger.register_model.

Used mainly to register from a child process.
"""
Expand All @@ -128,7 +128,7 @@ def _register_model_with_run_id_multiprocess(
logging.getLogger('composer').setLevel(composer_logging_level)

# Register model.
mlflow_logger.register_model_with_run_id(
mlflow_logger.register_model(
Copy link
Collaborator

Choose a reason for hiding this comment

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

we call this API because otherwise the run id doesn't get properly attached to the registered model, not because of retries.

model_uri=model_uri,
name=name,
await_creation_for=await_creation_for,
Expand Down Expand Up @@ -730,7 +730,7 @@ def tensor_hook(

# Spawn a new process to register the model.
process = SpawnProcess(
target=_register_model_with_run_id_multiprocess,
target=_register_model_multiprocess,
kwargs={
'mlflow_logger':
mlflow_logger,
Expand Down
Loading