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

Pytorch Autologging Description Added To Tracking.rst #3636

Merged
merged 10 commits into from Nov 9, 2020

Conversation

karthik-77
Copy link
Contributor

Signed-off-by: karthik-77 karthiks@ideas2it.com

What changes are proposed in this pull request?

Pytorch autolog description was added to the tracking.rst file.

How is this patch tested?

Documentation -NA

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/projects: MLproject format, project running backends
  • area/scoring: Local serving, model deployment tools, spark UDFs
  • area/server-infra: MLflow server, JavaScript dev server
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, JavaScript, plotting
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

How should the PR be classified in the release notes? Choose one:

  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

@github-actions github-actions bot added area/artifacts Artifact stores and artifact logging area/docs Documentation issues rn/documentation Mention under Documentation Changes in Changelogs. labels Nov 4, 2020
Signed-off-by: karthik-77 <karthiks@ideas2it.com>
…dded

Signed-off-by: karthik-77 <karthiks@ideas2it.com>

Call :py:func:`mlflow.pytorch.autolog` before your training code to enable automatic logging of metrics and parameters. See example usages with `Pytorch <https://github.com/chauhang/mlflow/tree/master/examples/pytorch/MNIST>`_.

In the current implementation, PyTorch autolog works with the `Lightning training loop <https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/trainer/training_loop.py>`_. The respective metrics associated with ``EarlyStopping Callabacks`` and ``pytorch_lightning.trainer`` are automatically logged. It must be noted that in case of a multi-optimizer scenario (such as usage of autoencoder) by default only the parameters for the first optimizer would be logged.
Copy link

Choose a reason for hiding this comment

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

@karthik-77 Please move the Optimizer note to the "Note" callout at the end (after the table)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes i have moved the Optimizer note to the "Note" Callout at the end

| | For example, ``stopped_epoch``, ``restored_epoch``, | For example, ``min_delta``, ``patience``, ``baseline``, | | Best Pytorch model Checkpoint if training stops due to early stopping callback. |
| | ``restore_best_weight``, etc. | ``restore_best_weights``, etc | | |
+------------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| ``pytorch-lightning trainer`` |Training loss;validation loss;average_test_accuracy; | ``fit()`` parameters; optimizer name; learning rate; epsilon | -- | Model summary on training start; `MLflow Model <https://mlflow.org/docs/latest/models.html>`_ (Pytorch model) on training end; |
Copy link

Choose a reason for hiding this comment

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

@karthik-77 Please change the sequence of the table rows. Move the pytorch-lightning trainer row to be the 1st row in the table

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the order. First row is the pytorch lightning trainer and the callback comes next,

Copy link

@chauhang chauhang left a comment

Choose a reason for hiding this comment

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

@karthik-77 Please see the comments inline. Rest look good

Signed-off-by: karthik-77 <karthiks@ideas2it.com>
Signed-off-by: karthik-77 <karthiks@ideas2it.com>
| | | | | |
| | | | | |
+------------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
|``trainer.callbacks.earlystopping`` |Training loss;validation loss;average_test_accuracy; | ``fit()`` parameters; optimizer name; learning rate; epsilon | -- | Model summary on training start; `MLflow Model <https://mlflow.org/docs/latest/models.html>`_ (Pytorch model) on training end; |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be pytorch_lightning.callbacks.early_stopping? https://pytorch-lightning.readthedocs.io/en/stable/early_stopping.html#early-stopping-based-on-metric-using-the-earlystopping-callback

I don't think a trainer.callbacks.earlystopping module exists

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The change has been incorporated.

+------------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| Framework/module | Metrics | Parameters | Tags | Artifacts |
+------------------------------------------+------------------------------------------------------------+-------------------------------------------------------------------------------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
|``pytorch-lightning trainer`` | Training loss; validation loss;average_test_accuracy; | ``fit()`` parameters; optimizer name; learning rate; epsilon. | -- | Model summary on training start; `MLflow Model <https://mlflow.org/docs/latest/models.html>`_ (Pytorch model) on training end; |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
|``pytorch-lightning trainer`` | Training loss; validation loss;average_test_accuracy; | ``fit()`` parameters; optimizer name; learning rate; epsilon. | -- | Model summary on training start; `MLflow Model <https://mlflow.org/docs/latest/models.html>`_ (Pytorch model) on training end; |
|Pytorch-Lightning Trainer`` | Training loss; validation loss;average_test_accuracy; | ``fit()`` parameters; optimizer name; learning rate; epsilon. | -- | Model summary on training start; `MLflow Model <https://mlflow.org/docs/latest/models.html>`_ (Pytorch model) on training end; |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The suggested change has been applied.

Copy link
Collaborator

@smurching smurching left a comment

Choose a reason for hiding this comment

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

Pushed some edits & had a few suggestions, otherwise looks good thanks @karthik-77!

@karthik-77
Copy link
Contributor Author

karthik-77 commented Nov 5, 2020 via email

@karthik-77
Copy link
Contributor Author

@smurching request you to kindly sign off the commits.

smurching and others added 6 commits November 9, 2020 11:55
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
…suggested changes

Signed-off-by: karthik-77 <karthiks@ideas2it.com>
Signed-off-by: karthik-77 <karthiks@ideas2it.com>
Signed-off-by: Sid Murching <sid.murching@databricks.com>
Signed-off-by: Sid Murching <sid.murching@databricks.com>
Signed-off-by: Sid Murching <sid.murching@databricks.com>
Copy link
Member

@harupy harupy left a comment

Choose a reason for hiding this comment

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

LGTM

@harupy harupy merged commit c3125d3 into mlflow:master Nov 9, 2020
eedeleon pushed a commit to eedeleon/mlflow that referenced this pull request Nov 13, 2020
* Added the pytorch autolog descriptionin the tracking.rst file

Signed-off-by: karthik-77 <karthiks@ideas2it.com>

* The parameter description for the mutli optimizer scenario has been added

Signed-off-by: karthik-77 <karthiks@ideas2it.com>

* The review comment for the autolog docs has been addressed

Signed-off-by: karthik-77 <karthiks@ideas2it.com>

* The review comment for the autolog docs has been addressed

Signed-off-by: karthik-77 <karthiks@ideas2it.com>

* Update tracking.rst

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>

* updated the tracking.rst file according to the reviewers comment and suggested changes

Signed-off-by: karthik-77 <karthiks@ideas2it.com>

* Corrected a punctuation error in the tracking.rst file

Signed-off-by: karthik-77 <karthiks@ideas2it.com>

* Update docs, fix autologging docstring

Signed-off-by: Sid Murching <sid.murching@databricks.com>

* Docstring fixes and wording updates

Signed-off-by: Sid Murching <sid.murching@databricks.com>

* Fix lint

Signed-off-by: Sid Murching <sid.murching@databricks.com>

Co-authored-by: Siddharth Murching <smurching@gmail.com>
Co-authored-by: Sid Murching <sid.murching@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/artifacts Artifact stores and artifact logging area/docs Documentation issues rn/documentation Mention under Documentation Changes in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants