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

Adds neptune plugin example #1723

Merged

Conversation

thomasjpfan
Copy link
Member

This PR adds documentation for the neptune plugin.

Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
Copy link
Contributor

@neverett neverett left a comment

Choose a reason for hiding this comment

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

Requesting changes since I think there are a few references to weights & biases that should be Neptune instead (but let me know if not!)

.. tags:: Integration, Data, Metrics, Intermediate
```

Neptune is the MLOps stack component for experiment tracking. It offers a single place to log, compare, store, and collaborate on experiments and models. This plugin enables seamless use of Neptune within Flyte by configuring links between the two platforms.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would link to Neptune docs here (assuming that's https://docs.neptune.ai/)

pip install flytekitplugins-neptune
```

To enable dynamic log links, add plugin to Flyte's configuration file:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To enable dynamic log links, add plugin to Flyte's configuration file:
To enable dynamic log links, add the plugin to Flyte's configuration file:

examples/neptune_plugin/README.md Show resolved Hide resolved
# %% [markdown]
# (neptune_example)=
#
# # Neptune Example
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# # Neptune Example
# # Neptune example

from flytekitplugins.neptune import neptune_init_run

# %% [markdown]
# First, we specify the neptune project that we will use with Neptune
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# First, we specify the neptune project that we will use with Neptune
# First, we specify the Neptune project that we will use with Neptune.


# %% [mardkwon]
# Next, we use `ImageSpec` to construct a container with the dependencies for our
# XGBoost training task. Please set the `REGISTRY` to an registry that your cluster can access;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# XGBoost training task. Please set the `REGISTRY` to an registry that your cluster can access;
# XGBoost training task. Please set the `REGISTRY` to a registry that your cluster can access.

# %%
# Next, we use the `neptune_init_run` decorator to configure Flyte to train an XGBoost
# model. The decorator requires an `api_key` secret to authenticate with Neptune and
# the task definition needs to requests the same `api_key` secret. In the training
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# the task definition needs to requests the same `api_key` secret. In the training
# the task definition needs to request the same `api_key` secret. In the training

# %% [markdown]
# First, we specify the neptune project that we will use with Neptune
# Please update `NEPTUNE_PROJECT` to the value associated with your account.
WANDB_PROJECT = "username/project"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be NEPTUNE_PROJECT instead of WANDB_PROJECT?

secret_requests=[api_key],
requests=Resources(cpu="2", mem="4Gi"),
)
@neptune_init_run(project=WANDB_PROJECT, secret=api_key)
Copy link
Contributor

Choose a reason for hiding this comment

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

If WANDB_PROJECT is changed above, this should also be updated.



# %%
# With Flyte's dynamic workflows, we scale up multiple training jobs with different
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# With Flyte's dynamic workflows, we scale up multiple training jobs with different
# With Flyte's dynamic workflows, we can scale up multiple training jobs with different

Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
Copy link
Contributor

@cosmicBboy cosmicBboy left a comment

Choose a reason for hiding this comment

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

a few typos, see comments

# [Flyte's Secrets manager](https://docs.flyte.org/en/latest/user_guide/productionizing/secrets.html).
api_key = Secret(key="neptune-api-token", group="neptune-api-group")

# %% [mardkwon]
Copy link
Contributor

Choose a reason for hiding this comment

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

mardkwon -> markdown

WANDB_PROJECT = "username/project"

# %% [markdown]
# W&B requires an API key to authenticate with their service. In the above example,
Copy link
Contributor

Choose a reason for hiding this comment

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

👆

examples/neptune_plugin/README.md Show resolved Hide resolved
Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Thomas J. Fan <[email protected]>
neverett
neverett previously approved these changes Oct 4, 2024
Copy link
Contributor

@neverett neverett left a comment

Choose a reason for hiding this comment

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

Approved, but I see the monodocs build is failing due to a missing DocSearch API key. #1740 should fix that.

@thomasjpfan thomasjpfan merged commit 568754e into flyteorg:master Oct 7, 2024
59 checks passed
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.

3 participants