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

Update MLflow integration #40

Merged
merged 58 commits into from Jun 21, 2023
Merged

Update MLflow integration #40

merged 58 commits into from Jun 21, 2023

Conversation

AleksanderWWW
Copy link
Contributor

No description provided.

@AleksanderWWW AleksanderWWW marked this pull request as draft May 5, 2023 17:51
Copy link
Contributor

@normandy7 normandy7 left a comment

Choose a reason for hiding this comment

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

Might just be me, but I think "neptune mlflow exporter" sounds like exporting from Neptune to MLflow. Maybe it doesn't matter too much if this string of words is just internal, though.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
src/neptune_mlflow_exporter/__init__.py Outdated Show resolved Hide resolved
src/neptune_mlflow_exporter/__init__.py Outdated Show resolved Hide resolved
src/neptune_mlflow_exporter/__init__.py Outdated Show resolved Hide resolved
src/neptune_mlflow_exporter/__init__.py Show resolved Hide resolved
normandy7
normandy7 previously approved these changes May 31, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure? We're not testing it on Windows currently 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now we are 😉

packages=find_packages(where="src"),
platforms="any",
install_requires=requirements,
entry_points={"neptune.plugins": "mlflow = neptune_mlflow_plugin:sync"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still support it? I saw a cmdline tool but this syntax looks like a MLFlow plugins triggers or something like that.

@@ -0,0 +1,64 @@
#
# Copyright (c) 2019, Neptune Labs Sp. z o.o.
Copy link
Contributor

Choose a reason for hiding this comment

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

⌛ 2️⃣ 0️⃣ 2️⃣ 3️⃣ 😜

import os
from typing import Optional

import neptune
Copy link
Contributor

Choose a reason for hiding this comment

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

neptune is optional, don't we wanna return something in case of a lack of package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

checkout neptune_mlflow_exporter/impl/version.py file

project_name: Optional[str] = None,
api_token: Optional[str] = None,
mlflow_tracking_uri: Optional[str] = None,
exclude_artifacts: bool = True,
Copy link
Contributor

Choose a reason for hiding this comment

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

neptune_run[f"run_data/metrics/{key}"].append(val)

del data_dict["metrics"]
neptune_run["run_data"] = data_dict
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's log it before the metrics. This line looks really weird if someone doesn't know how the logging works (looks like deleting the run_data/metrics right after we logged the values 😜 ).

src/neptune_mlflow_exporter/impl/utils.py Outdated Show resolved Hide resolved
src/neptune_mlflow_exporter/impl/utils.py Outdated Show resolved Hide resolved
src/neptune_mlflow_exporter/impl/utils.py Outdated Show resolved Hide resolved
from neptune.new.metadata_containers import Run


class ArtifactUploadStrategy(ABC):
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be simplified by a lot. The logic is much more common for both strategies. In general:

  • Ensure the size is ok - No need to differentiate as it could be generalized
  • Download artifact (could be downloaded to some "temp" directory to simplify) - No need to differentiate
  • Upload file/files (this is the only part that I think needs to depend on artifact type)
  • Clean the "temp" directory with shutil.rmtree - No need to differentiate

src/neptune_mlflow_exporter/__init__.py Outdated Show resolved Hide resolved
src/neptune_mlflow_exporter/impl/sync.py Outdated Show resolved Hide resolved
max_results=page_limit, page_token=page_token, view_type=ViewType.ACTIVE_ONLY
)

all_experiments.extend(experiments)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about a Generator here? I mean using yield experiments instead

src/neptune_mlflow_exporter/impl/components/exporter.py Outdated Show resolved Hide resolved
@AleksanderWWW AleksanderWWW merged commit e700b83 into master Jun 21, 2023
7 checks passed
@AleksanderWWW AleksanderWWW deleted the aw/update-integration branch June 21, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants