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
Conversation
There was a problem hiding this 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.
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
"License :: OSI Approved :: Apache Software License", | ||
"Natural Language :: English", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows", |
There was a problem hiding this comment.
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 😉
There was a problem hiding this comment.
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"}, |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default in click logic is False
: https://github.com/neptune-ai/neptune-mlflow/pull/40/files#diff-ad53078777fa4f7014626a7cad1bee9090623bab90d6888d16d9e0e49ea37906R28
neptune_run[f"run_data/metrics/{key}"].append(val) | ||
|
||
del data_dict["metrics"] | ||
neptune_run["run_data"] = data_dict |
There was a problem hiding this comment.
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 😜 ).
from neptune.new.metadata_containers import Run | ||
|
||
|
||
class ArtifactUploadStrategy(ABC): |
There was a problem hiding this comment.
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/impl/neptune_exporter/neptune_exporter.py
Outdated
Show resolved
Hide resolved
max_results=page_limit, page_token=page_token, view_type=ViewType.ACTIVE_ONLY | ||
) | ||
|
||
all_experiments.extend(experiments) |
There was a problem hiding this comment.
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
No description provided.